Write an application that handles a student report card. The application shall save the marks of computer science, math and English. Each subject has a total of 50 marks. If a student obtains at least 75/150 marks, an event will trigger and show a congratulation message on passing the exam. Otherwise, it will display an “F” grade.
using System;
namespace Questions
{
class Program
{
static bool IsExamPassed(double computerScience, double math, double english)
{
return (computerScience + math + english) >= 75;
}
static void Main()
{
Console.Write("Computer science mark: ");
double computerScience = double.Parse(Console.ReadLine());
Console.Write("Math mark: ");
double math = double.Parse(Console.ReadLine());
Console.Write("English mark: ");
double english = double.Parse(Console.ReadLine());
Console.WriteLine();
if (IsExamPassed(computerScience, math, english))
Console.WriteLine("Congratulations!!! You passed exam!!!");
else
Console.WriteLine("Grade: F");
Console.WriteLine();
Console.ReadKey();
}
}
}
Comments
Leave a comment