Skip to content

Enter a numerical score. The program will print a corresponding letter grade.

Notifications You must be signed in to change notification settings

CSchnelle/Letter-Grade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Letter-Grade Assignment

Description of the Problem:

Write a game program. The computer will ask the user to input a score. The program will first check if the score is valid (between 0 and 100, inclusive). If the score is not valid, print out the error message and exit the program. Otherwise, display the corresponding letter grade. . Requirements:

  1. You need first use if statement to decide whether the input is valid. If not, print out the error message and exit the program.
  2. You need use if-else structure to display the letter grade.
  3. Comment away the code (do NOT delete it) and rewrite it by using switch structure (please notice that in general, you may not be able to rewrite an if-else statement to switch statement. However, in this particular case, there is a trick to do so easily)
  4. In this program, we don’t validate user’s input. We assume that user will enter a score between 0 and 100 inclusive. After we study loop (Chapter 4), we can validate the input. As long as the user’s input is out of the legal range, the program will keep to prompt the user to enter a legal score

How to run program:

Install Java: https://java.com/en/download/help/download_options.xml

Open CMD or Terminal and go to the directory where you've downloaded the Java file. Use the java command to execute the file: "java CatherineSchnelle_Project03.java"

About

Enter a numerical score. The program will print a corresponding letter grade.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages