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

  Program that inputs a word representing a binary number

Write a program that inputs a word representing a binary number (0s and 1s). First your program should verify that it is indeed a binary number, that is the number contains only 0s and 1s.

  Develp a simple model of an object-oriented system

you are going to develp a simple model of an object-oriented system. this model should be able to provide all the working examples of inheritance, encapsulation, and polymorphism through the use of class,. methods, and objects

  If the number on two of the players'' four cards

If the number on two of the players' four cards is the same and the number on the remaining two cards is also the same yet the number on all four cards in not the same then the player gets their bet back and in addition wins 22 chips for each chip th..

  How can i connect from an applet to a database on the server

1) How do I create an applet that accepts an unlimited number of parameters? 2) How can I connect from an applet to a database on the server?

  What is an infinite loop

What is an "off-by-one error"? Give an example for it from your experience.What is an infinite loop? Write a for statement to demonstrate it.

  Write a java program called salesinfominer

Write a Java program called SalesInfoMiner that reads in a file of products, stored in text format. The program must then read in information about past sales transactions and output all the products to a new file, sorted by product description,..

  Give at least one constructor without any parameter

We learned as popular Set implementation. Write own TreeSet class that implements following interface: You are to give at least one constructor without any parameter.

  Creates an object of type fahrenheit

Creates an object of type Fahrenheit and an object of type Celsius - Accepts a single argument from the command line

  What are the main differences between java programming

question 1 what are the major differences between java programming language and any other language? list and discuss

  Assignment related to java programming

Question 1: Write a java program to compute the squares of the numbers in the array list like 1, 2, 3, 4... up to 50. Question 2: Write a java program to compute the sum of numbers and average in the array list up to 50.

  Programming exercises

Programming Exercises 1. Write an application named BadSubscriptCaught in which you declare an array of 10 first names. Write a try block in which you prompt the user for an integer and display the name in the requested position.

  Chat monitoring system

The name of the project is chat monitoring system. in the file you will see the screenshot diagram 2A are my design, i want it to be upgrade, to look professional like the diagram 2B. please java, netbeans and GUI. please can I have only the client s..

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