Bing In

Bing In

  • NA
  • 30
  • 9k

making a scorecard

Apr 9 2016 1:54 AM
*****************************************************************
ID number      name    mid-term score      final-term score     total exam score     average score    grade
 
******************************************************************
 
input by user       input by user          input by user           input by user        input by user       input by user    input by user
 
 

  
help me make a scorecard above
bold type is drawn initially 
only if else and Console.ReadLine() or Console.Read() and Console.WriteLine() are used   
 
 
using System;
class example11
{
public static void Main()
{
Console.WriteLine("***************************************"); 
Console.WriteLine("ID name midexam finalexam total average grade"); 
Console.WriteLine("***************************************"); 
 
int id = Console.Read();
char name = Console.Read();
int mid = Console.Read();
int last = Console.Read();
int total = mid + last;
int avg = total / 2;
if (avg >= 90 && avg <= 100) 
{
Console.WriteLine(id, name, mid, last, total, avg, "A");
}
else if (avg > 80 && avg < 89) 
{
Console.WriteLine(id, name, mid, last, total, avg, "B");
}
else if (avg > 70 && avg < 79) 
{
Console.WriteLine(id, name, mid, last, total, avg, "C");
}
else if (avg > 60 && avg < 69) 
{
Console.WriteLine(id, name, mid, last, total, avg, "D");
}
else if (avg > 0 && avg < 59) 
{
Console.WriteLine(id, name, mid, last, total, avg, "F");
}
}
}
 
 

Answers (1)