How to solve this question?
Posted: Sun Jul 10, 2022 11:27 am
How to solve this question?
2. Consider the following program. What will be the output (a) if the value of a is 1.9 and (b) if the value of a is 3.2? Explain your answer. [6 marks] using System; public class Program { { } static void check (double gpa) if (gpa < 2) { throw new Arithmetic Exception ("You cannot graduate"); } else { } Console.WriteLine("You are graduated"); public static void Main() { double a; Console.WriteLine("Enter your GPA "); } a = double.Parse(Console.ReadLine()); M109 TMA Summer 2022 check(a); 3/6 ... ...
2. Consider the following program. What will be the output (a) if the value of a is 1.9 and (b) if the value of a is 3.2? Explain your answer. [6 marks] using System; public class Program { { } static void check (double gpa) if (gpa < 2) { throw new Arithmetic Exception ("You cannot graduate"); } else { } Console.WriteLine("You are graduated"); public static void Main() { double a; Console.WriteLine("Enter your GPA "); } a = double.Parse(Console.ReadLine()); M109 TMA Summer 2022 check(a); 3/6 ... ...