double A1;
double A2and3;
double score;
double percentage;
//Input
Console.WriteLine("Grade Calculation");
Console.WriteLine("");
Console.WriteLine("What mark did the student get in Assignment 1?");
A1 = double.Parse(Console.ReadLine());
Console.WriteLine("What mark did the student get in Assignment 2 and
3?");
A2and3 = double.Parse(Console.ReadLine());
//Process
score = A1 + A2and3;
percentage = (score / 150) * 100;
double percentageround = Math.Round(percentage, 0);
//Output
if (percentageround > 70 && percentageround < 100)
{
Console.Write("The student got {0}% and got a Distinction",
percentageround);
}
else if (percentageround > 60 && percentageround < 69)
{
Console.Write("The student got {0}% and got a Merit",
percentageround);
}
else if (percentageround > 50 && percentageround < 59)
{
Console.Write("The student got {0}% and got a Pass",
percentageround);
}
else if (percentageround > 40 && percentageround < 49)
{
Console.Write("The student got {0}% and got a Refer",
percentageround);
}
else if (percentageround < 40)
{
Console.Write("The student got {0}% and failed", percentageround);
}
Console.ReadLine();