Difference between revisions of "Letter Grade Conversion"

From CompSciWiki
Jump to: navigation, search
Line 6: Line 6:
 
<br>'''B, C''' (Average)  
 
<br>'''B, C''' (Average)  
 
<br>'''D,F''' (Below Average)
 
<br>'''D,F''' (Below Average)
<br>Your second task is to provide the user which category the grade falls on.  For example, if the user typed in "78" as the input and is considered as a B, you must also output its category as "Average".  Input must be handled using  JOptionPane.showInputDialog(), and output using System.out.println().  Ensure that necessary validity checks are done in the program to prevent invalid input to generate valid output.     
+
<br>Your second task is to provide the user which category the grade falls on.  For example, if the user typed in "78" as the input and is considered as a B, you must also output its category as "Average".  Input must be handled using  JOptionPane.showInputDialog(), and output using System.out.println().  Ensure that necessary validity checks are done in the program to prevent invalid input.     
  
  

Revision as of 00:48, 8 April 2010

Back to the Program-A-Day homepage

Problem

Create a program that converts a numerical grade to its corresponding letter grade. Your first task is to assign the numerical range for each corresponding letter. The letter grades that need assigning are:
A (Above Average)
B, C (Average)
D,F (Below Average)
Your second task is to provide the user which category the grade falls on. For example, if the user typed in "78" as the input and is considered as a B, you must also output its category as "Average". Input must be handled using JOptionPane.showInputDialog(), and output using System.out.println(). Ensure that necessary validity checks are done in the program to prevent invalid input.

 

If Statements and Named Constants

Wiki sign01.jpg

Solution

The solution...

Code

Solution Code

Back to the Program-A-Day homepage