Purchase Solution

Java Sample Program: Grading Application

Not what you're looking for?

Ask Custom Question

I need some help with writing a program.

Your program should output a title similar to "Welcome to Ken's Grading Program", using your own name of course.

Your program should prompt the user if they will be entering numbers or letters for grades. See example below.

If the user enters 'numbers':
Get input for the grade number in decimal format. i.e. 74.22645 (enter it with 5 decimal places)
Utilize the Math class and round the number to zero decimal places, then use the int cast method to convert to an integer.(ensure you round it before type casting it)
Utilize a switch statement to determine the corresponding letter grade. Use the grading criteria from this course for the numbers. (ensure you accept all allowable numbers i.e. 70-79 and all in between)
Output the corresponding letter grade along with the initial number entered in decimal format utilizing the printf method and format specifiers. Output the number in only 3 decimal places.

If the user enters 'letters':
Get input for the grade letter in String format.
Utilize a switch statement to determine the corresponding output for the letter entered. (ensure you accept both upper and lower case letters.
Use the grading criteria from this course for the numbers. (you must use charAt( ) so the string will work with your switch)
Output the corresponding numbers values for the letter entered along with the letter initially entered.
Example Output:

If numbers was entered
Welcome to Grading Pro
Will you be entering numbers or letters?
Enter 'numbers' or 'letters'
numbers
Enter a number in the format 74.22645
74.22645
C - 74.226
Press any key to continue . . .

if letters was entered
Welcome to Grading Pro
Will you be entering numbers or letters?
Enter 'numbers' or 'letters'
letters
Enter a letter in String format
C
70-79 - C
Press any key to continue . . .

Options:
This requests you to obtain a double number from the user and then round it and/or type cast it into an integer. This integer number is later used in a switch to determine the letter grade. If you follow these instructions and you find satisfactory results, all the best for you.
If on the other hand, you find out that the best way for you to provide a letter grade is using a set of if-else statements instead.

Purchase this Solution

Solution Summary

This response provides guidelines to create a Java program that allows the user to enter letter and numbers for grades.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.