Answer to Question #251052 in C# for James

Question #251052

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.


1
Expert's answer
2021-10-13T20:25:58-0400
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();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS