Question

Please use the Java Programming language. This is the introductory course, chapter two. Please only use...

Please use the Java Programming language. This is the introductory course, chapter two. Please only use if/else if, else and while loop. We have not touch base with do and while do(I don't know if while do exist in Java).

Create an application that converts number grades to letter grades.

Console

Welcome to the Letter Grade Converter

Enter numerical grade: 90

Letter grade: A

Continue? (y/n): y

Enter numerical grade: 88

Letter grade: A

Continue? (y/n): y

Enter numerical grade: 80

Letter grade: B

Continue? (y/n): y

Enter numerical grade: 67

Letter grade: C

Continue? (y/n): y

Enter numerical grade: 59

Letter grade: F Continue? (y/n): n

Specifications • The grading criteria is as follows: A 88-100 B 80-87 C 67-79 D 60-67 F <60 • Assume that the user will enter valid integers between 1 and 100 for the grades. • The application should continue only if the user enters “y” or “Y” to continue.

Homework Answers

Answer #1
//LetterGradeConverter.java
import java.util.Scanner;
public class LetterGradeConverter {
    public static void main(String[] args) {
        Scanner scnr = new Scanner(System.in);
        System.out.println("Welcome to the Letter Grade Converter");
        String choice = "y";
        while(choice.equals("y")) {
            System.out.print("Enter numerical grade: ");
            double grade = scnr.nextDouble();
            String output;

            if(grade >= 88){
                output = "A";
            }
            else if(grade >= 80){
                output = "B";
            }
            else if(grade >= 67){
                output = "C";
            }
            else if(grade >= 60){
                output = "D";
            }
            else {
                output = "F";
            }

            System.out.println("Letter grade: " + output);

            System.out.print("Continue? (y/n): ");
            choice = scnr.next();
        }
    }
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Create a Grade application that prompts the user for the percentage earned on a test or...
Create a Grade application that prompts the user for the percentage earned on a test or other graded work and then displays the corresponding letter grade. The application should use the grading scale at your school or the following grading scale: 90 – 100 A 80 – 89 B 70 – 79 C 60 – 69 D below 60 F The application output should look similar to: Enter your marks: 90 Grade: A Notes: coded in java. Please don't make...
Write a Java program to display a letter grade based on an actual grade. A =...
Write a Java program to display a letter grade based on an actual grade. A = 90-100 B = 80-89 C = 70-79 D = 60-69 F = less than 60 The program needs to do the following: 1. Create a short integer to store a grade. (See Week 3 - Things to Know - Java Data Types ) 2. Prompt for a grade ( 0-100). 3. Based on the grade given, use IF statements to display the letter grade...
Java: A teacher has five students who have taken four tests. The teacher uses the following...
Java: A teacher has five students who have taken four tests. The teacher uses the following grading scale to assign a letter grade to a student, based on the average of his or her four test scores: Test Score Letter Grade 90–100 A 80–89 B 70–79 C 60–69 D 0–59 F Write a class that uses a String array (or an ArrayList object) to hold the five students’ names, an array of five characters to hold the five students’ letter...
is there anything wrong with the solution. the question are from java course Write a main...
is there anything wrong with the solution. the question are from java course Write a main method that will request the user to enter Strings using a JOptionPane input dialog. The method should continue accepting strings until the user types “STOP”.       Then, using a JOptionPane message dialog, tell the user how many of the strings begin and end with a digit. Answer: import javax.swing.*; public class IsAllLetters {     public static void main(String[] args) {         String input;         int count =...
Complete Programming Assignment Chapter 10. Use program In JAVA ProductCodes.java on pages 446-447, it will provide...
Complete Programming Assignment Chapter 10. Use program In JAVA ProductCodes.java on pages 446-447, it will provide you most of the needed code. You are to design and implement a program that reads a series of 10 integers from user and print the average. Read each integer as a string and convert to integer using Integer.parseInt method. If this process throws a NumberFormatException (not a valid number), catch and handle the exception by printing an error message "Not a valid entry,...
This is a program and my solution. How many times should I test, if I need...
This is a program and my solution. How many times should I test, if I need full coverage of all possible program flows?  Why? Write a program that prompts the user for a grade (0-100) and, whether the student is a graduate student (Y/N). If the student is a graduate student, their grade is reduced by 10%, because we have a higher expectation for a graduate students in an undergraduate class. The program then computes and prints the letter grade is...
IN JAVA!! You may be working with a programming language that has arrays, but not nodes....
IN JAVA!! You may be working with a programming language that has arrays, but not nodes. In this case you will need to save your BST in a two dimensional array. In this lab you will write a program to create a BST modelled as a two-dimensional array. The output from your program will be a two-dimensional array.   THEN: practice creating another array-based BST using integers of your choice. Once you have figured out your algorithm you will be able...
JAVA ASSIGNMENT 1. Write program that opens the file and process its contents. Each lines in...
JAVA ASSIGNMENT 1. Write program that opens the file and process its contents. Each lines in the file contains seven numbers,which are the sales number for one week. The numbers are separated by comma.The following line is an example from the file 2541.36,2965.88,1965.32,1845.23,7021.11,9652.74,1469.36. The program should display the following: . The total sales for each week . The average daily sales for each week . The total sales for all of the weeks .The average weekly sales .The week number...
***Programming language is Java. After looking at this scenario please look over the requirements at the...
***Programming language is Java. After looking at this scenario please look over the requirements at the bottom (in bold) THIS IS ALL THAT WAS PROVIDED. PLEASE SPECIFY ANY QUESTIONS IF THIS IS NOT CLEAR (don't just say more info, be specific)*** GMU in partnership with a local sports camp is offering a swimming camp for ages 10-18. GMU plans to make it a regular event, possibly once a quarter. You have been tasked to create an object-oriented solution to register,...
The assignment below has three pseudocodes below I need to fix the debug exercises in it....
The assignment below has three pseudocodes below I need to fix the debug exercises in it. Please help. Thanks. Highlight or mark in bold the corrections. Thanks! //DEBUG06-01 // A high school is holding a recycling competition, // and this program allows a user to enter a student's // year in school (1 through 4) and number of cans collected // for recycling. Data is entered continuously until the user // enters 9 for the year. // After headings, output...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT