In: Computer Science
Write a single, complete If-else-if segment of code based on a variable called ‘Average’ which will process the following task:
Variable=average;
If (average >=95);
{
messagebox.show(“you made the deans list”);
}
(B) Display "You made the Optimate Society” if Average >= 90
Else if (average>=90);
}
Messagebox.show(“you made the Optimate Society”);
}
(C) Otherwise Display "You need a 90 to make an honors list"
Else if (average <=89);
{
Messagebox.show(“you need a 90 to make an honors list”);
using System;
class MainClass
{
public static void Main (string[] args)
{
Console.Write("Enter the average: ");
int average = Convert.ToInt32(Console.ReadLine());
if(average >= 95)
Console.WriteLine("You made the dean's list");
else if(average >= 90)
Console.WriteLine("You made the Optimate Society");
else
Console.WriteLine("You need a 90 to make an honors list");
}
}
********************************************************************** SCREENSHOT *****************************************************