Question

In: Computer Science

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.

Solutions

Expert Solution

//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();
        }
    }
}


Related Solutions

Instructions: 1. Please use only C as the language of programming. 2. Please submit the following:...
Instructions: 1. Please use only C as the language of programming. 2. Please submit the following: (1) the client and the server source files each (2) a brief Readme le that shows the usage of the program. 3. Please appropriately comment your program and name all the identifiers suitable, to enable enhanced readability of the code. Problem: Write an ftp client and an ftp server such that the client sends a request to ftp server for downloading a file. The...
JAVA programming - please ONLY answer prompts with java code *Inheritance* will be used in code...
JAVA programming - please ONLY answer prompts with java code *Inheritance* will be used in code Classwork A zoo is developing an educational safari game with various animals. You will write classes representing Elephants, Camels, and Moose. Part A Think through common characteristics of animals, and write a class ZooAnimal. ☑ ZooAnimal should have at least two instance variables of different types (protected), representing characteristics that all animals have values for. ☑ It should also have at least two methods...
Please use Java language to write an efficient function that compute the intersection of two arrays...
Please use Java language to write an efficient function that compute the intersection of two arrays of integers (not necessary sorted).
Be sure to use only C for the Programming Language in this problem. Before we start...
Be sure to use only C for the Programming Language in this problem. Before we start this, it is imperative that you understand the words “define”, “declare” and “initialize” in context of programming. It's going to help you a lot when following the guidelines below. Let's begin! Define two different structures at the top of your program. be sure to define each structure with exactly three members (each member has to be a different datatype). You may set them up...
Java Language Only Use Java FX In this project we will build a BMI calculator. BMI...
Java Language Only Use Java FX In this project we will build a BMI calculator. BMI is calculated using the following formulas: Measurement Units Formula and Calculation Kilograms and meters (or centimetres) Formula: weight (kg) / [height (m)]2 The formula for BMI is weight in kilograms divided by height in meters squared. If height has been measured in centimetres, divide by 100 to convert this to meters. Pounds and inches Formula: 703 x weight (lbs) / [height (in)]2 When using...
Please use Java language to write two efficient functions: Write an efficient function that compute the...
Please use Java language to write two efficient functions: Write an efficient function that compute the intersections of two sorted arrays of integers Write an efficient function that compute the intersection of two arrays of integers (not necessary sorted).
Please use the Scheme programming language with Dr. Racket to solve a and b below. (Use...
Please use the Scheme programming language with Dr. Racket to solve a and b below. (Use Scheme and not Python) Write before–in–list?, which takes a list and two elements of the list. It should return #t if the second argument appears in the list argument before the third argument: > (before–in–list? '(back in the ussr) 'in 'ussr) #T > (before–in–list? '(back in the ussr) 'the 'back) #F The procedure should also return #f if either of the supposed elements doesn't...
In JAVA Language Please! Programming Exercise 3.20 required you to design a PID manager that allocated...
In JAVA Language Please! Programming Exercise 3.20 required you to design a PID manager that allocated a unique process identifier to each process. Exercise 4.20 required you to modify your solution to Exercise 3.20 by writing a program that created a number of threads that requested and released process identifiers. Now modify your solution to Exercise 4.20 by ensuring that the data structure used to represent the availability of process identifiers is safe from race conditions. Use Pthreads mutex locks....
***Please answer the question using the JAVA programming language. Write a program that calculates mileage reimbursement...
***Please answer the question using the JAVA programming language. Write a program that calculates mileage reimbursement for a salesperson at a rate of $0.35 per mile. Your program should interact (ask the user to enter the data) with the user in this manner: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer reading > 13505.2 Enter ending odometer reading > 13810.6 You traveled 305.4 miles. At $0.35 per mile, your reimbursement is $106.89. ** Extra credit 6 points: Format the answer (2 points),...
Answer the following in Java programming language Create a Java Program that will import a file...
Answer the following in Java programming language Create a Java Program that will import a file of contacts (contacts.txt) into a database (Just their first name and 10-digit phone number). The database should use the following class to represent each entry: public class contact {    String firstName;    String phoneNum; } Furthermore, your program should have two classes. (1) DatabaseDirectory.java:    This class should declare ArrayList as a private datafield to store objects into the database (theDatabase) with the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT