Program translates a number into the closest letter grade

Assignment Help JAVA Programming
Reference no: EM13940626

Write a Java program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade; for example, 2.85 should be a B. Any value >= 4.15 should be an A+.

Write a class Grade with a method getLetterGrade.

Here is a sample program run:

Enter a numeric value:
2.85
Letter grade: B

Use the following class as your main class:

import java.util.Scanner;

/**
This class prints the letter grade corresponding to a numeric value given
by the user.
*/
public class GradePrinter
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);

System.out.println("Enter a numeric value:");
double numGrade = in.nextDouble();

Grade g = new Grade(numGrade);

System.out.println("Letter grade: " + g.getLetterGrade());
}
}

Reference no: EM13940626

Questions Cloud

Classify the charges associated with cellular phone service : Assume that Jana will use, on average, 45 minutes per month in local calling.  Classify the charges associated with the cellular phone service as (a) committed resources or (b) flexible resources.
Find the angular acceleration and the time taken : Find (a) the angular acceleration, (b) the time taken, (c) the work done, (d) the maximum power developed, (e) the distance travelled by a point on the rim of the flywheel.
Copycat crimes are certainly not new phenomena : Copycat crimes are certainly not new phenomena.  Tylenol bottles laced with poison on supermarket shelves (1982), syringes planted in Pepsi cans (1993), and letters purposely containing deadly anthrax (2001) all occurred in years when a wave of simil..
Explain the pennsylvania superior court ruling : The plaintiff raises the following question: When the Crime Victims' Employment Protection Act was written, did the Legislature intend to protect crime victims who have not yet attended their hearings, from threats, coercion, and loss of employmen..
Program translates a number into the closest letter grade : Write a Java program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-
How much more or less expense was booked : What journal entries did they book to go from the beginning balance to the ending balance? How much more or less expense was booked under the accrual basis than the cash basis?
Find the angular acceleration : Find (a) the angular acceleration, (b) the time taken for the speed to increase, (c) the work done, (d) the average power developed, (e) the maximum power developed.
Explaining the major reasons why you support consumer : Prepare an argument explaining the major reasons why you support either the consumer or the industry.
Calculate the time taken to complete the first revolutions : A winding drum is accelerated from 480 to 840 rpm in a time of 2 s. Acceleration continues at the same rate for a further 4 s after which the drum continues rotating at a steady speed. Calculate the time taken to complete the fi rst 200 revolution..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd