Question
using System; namespace HelloWorld { class Program { static void Main(string[] args) { Console.WriteLine(Hi, I'm Thomas, these are my grades.); Console.WriteLine(); Console.WriteLine(Algebra: + letterGrade(80));
using System;
namespace HelloWorld { class Program { static void Main(string[] args) { Console.WriteLine("Hi, I'm Thomas, these are my grades."); Console.WriteLine(); Console.WriteLine("Algebra: " + letterGrade(80)); Console.WriteLine("Systems Programming: " + letterGrade(25)); Console.WriteLine("Philosophy: " + letterGrade(100)); Console.WriteLine("Psychology: " + letterGrade(75)); Console.WriteLine("English: " + letterGrade(60)); } public static string letterGrade(int grade) { if (grade > 89) { return "A"; } else { return "F"; } } } }
2. Change the code in the letter grade function so that it accounts for Bs (80-89), Cs (70-79), and Ds (60-69). Do not change the code in the main function, as this code represents five test cases for the letter grade function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started