Problem: Excellent Grade

The first exercise for this topic is to write a console program that inputs the grade (decimal number) and prints Excellent! if the grade is 5.50 or higher.

Sample Input and Output

Input Output
6 Excellent!
5 (no output)
5.5 Excellent!
5.49 (no output)

Creating a New C# Project

We create a new project in the existing Visual Studio solution. In Solution Explorer, right-click on Solution 'Simple-Conditions'. Then choose [Add] -> [New Project]:

A dialog box will open for selecting a project. Choose C# console application and specify a name, for example "Excellent-Result":

Now we have a solution with one console application in it. What remains is to write the code to solve the problem.

Writing the Program Code

For this purpose, we go into the body of the Main (string [] args) method and write the following code:

Run the program with [Ctrl+F5], to test it with different input values:

Testing in the Judge System

Test your solution from the example here:

results matching ""

    No results matching ""