76 812
Assignments Done
Successfully Done
In June 2019

Answer to Question #48996 in Other Engineering for salah abu zaid

Question #48996
Write a program that can enter marks for 1 student and calculate his total and
grade with the following format
The inputs:
ID (As Integer), First (As Double), Second (As Double), Final (As Double), Total (As
Double) and Grad (As Char)
The Grades are: A for 90’s, B for 80’s, C for 70’s, D for 60’s and F for less than 60.
The output:
St_Nm ID First Second Final Average Grade
Expert's answer
Answer on Question #48996,Engineering, Other

using System;
using System.Linq;
using System.Text;

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);


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions