Skip to content

Making a scorecard

Bing In

Asked Apr 8, 2016, 9:54 PM EDT1 answer
Share
LinkedInX
*****************************************************************
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   
 
 
C#
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");
Code
        }
        else if (avg > 80 && avg < 89)
        {
Console.WriteLine(id, name, mid, last, total, avg, "B");
Code
        }
        else if (avg > 70 && avg < 79)
        {
Console.WriteLine(id, name, mid, last, total, avg, "C");
Code
        }
        else if (avg > 60 && avg < 69)
        {
Console.WriteLine(id, name, mid, last, total, avg, "D");
Code
        }
        else if (avg > 0 && avg < 59)
        {
Console.WriteLine(id, name, mid, last, total, avg, "F");
Code
        }
    }
}

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    SQL
    Console.WriteLine(id, name, mid, last, total, avg, "A");
    Console.WriteLine(id, name, mid, last, total, avg, "B");
    Console.WriteLine(id, name, mid, last, total, avg, "C");
    Console.WriteLine(id, name, mid, last, total, avg, "D");
    Console.WriteLine(id, name, mid, last, total, avg, "F");
     
    underline on id error message occurs 
    cannot convert from 'int' to 'string'  
    0