Answer on Question #48996,Engineering, Other
using System;
usingSystem.Collections.Generic;
using System.Linq;
using System.Text;
namespaceConsoleApplication45
{
class Program
{
static void Main()
{
int ID;
double First,Second,Final,Total;
char Grad;
int St_Nm;
Console.Write("enter number ofstudent ");
St_Nm =int.Parse(Console.ReadLine());
Console.Write("enterstudent ID ");
ID =int.Parse(Console.ReadLine());
Console.Write("enter firstmark ");
First =double.Parse(Console.ReadLine());
Console.Write("entersecond mark ");
Second =double.Parse(Console.ReadLine());
Console.Write("enter finalmark ");
Final = double.Parse(Console.ReadLine());
Total = First + Second + Final;
if (Total >= 90) Grad = 'A';
if ((Total >= 80) &&(Total < 90)) Grad = 'B';
if ((Total >= 70) &&(Total < 80)) Grad = 'C';
if ((Total >= 60) &&(Total < 70)) Grad = 'D';
else Grad = 'F';
Console.WriteLine("St_NmID First Second Final Average Grade");
Console.WriteLine(St_Nm +"\t" + ID + "\t" + First + "\t" + Second +
"\t" + Final + "\t" + Total + "\t" + Grad);
Console.ReadLine();
}
}
}
Comments
Leave a comment