Translates a number into the closest letter grade

Assignment Help JAVA Programming
Reference no: EM13708804

Program: Write a program that translates a number into the closest letter grade. For case, 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 case, 2.85 should be a B. Any value ?4.15 should be an A+.

Use a class Grade with a method getLetterGrade.

Here is a sample program run:

Enter a numeric value:

2.85

Letter grade: B

Use the subsequent 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());

   }

}

You need to supply the subsequent class in your solution. Can someone demonstrate me how to write a proper code for this problem and how to complete it. Thanks

Reference no: EM13708804

Questions Cloud

Show the rbt after the bst-style deletion : Show the RBT after the BST-style deletion but before RB-Delete-Fixup - Identify whether there is a double black identifying the node, corresponding to underflow
Sum of the odd positions of the list : Write a function that takes a list of integers as argument and returns a pair consisting of the sum of the even positions and the sum of the odd positions of the list.
Explain the path a process : Explain the path a process might take through the five states specified in the five-state model discussed in the text?
Two dimensional int array to hold the prices of the seats : The Theater class shows a theater with an auditorium containing a fixed number of seats arranged in rows with each seat selling for a exacting price. The instance variables for the theater are:
Translates a number into the closest letter grade : Write a program that translates a number into the closest letter grade. For case, the number 2.8 which might have been the average of several grades would be converted to B-
Sums each component of the pairs : Write a version of sumPairs of Ex. 3.1.8 that sums each component of the pairs discretely, returning a pair consisting of the sum of the first components and the sum of the second components. So essentially [(3,1)(10,3)] would return (13,4).
The boiling points of alcohols are lower than the ketones : Question- The boiling points of alcohols are lower than the corresponding ketones with similar molecular weight.
Calculate the solubility of cubr : Question- Copper (i) ions in aqueous solution react with NH3 (aq) according to Cu^+ (aq) + 2NH3 (aq) ----------------> Cu (NH3)2^+ (aq) Kf = 6.3 X 10 ^10 Calculate the solubility (in g * L^-1) of CuBr (s) (Ksp = 6.3 X 10 ^-9) in 0.88 M NH3 (a..
Design an adt for a two-color : Design an ADT for a two-color, double-stack ADT that consists of two stacks one "red" and one "blue" and has as its operations color-coded versions of the regular stack ADT operations.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Statements to create a collection of integers

Write Java statements to create a collection of integers, and to initialize each element of the collection to -1. Then, using a for each statement to print the value of each element.

  Create an array of size n and fill it

Sketch a high level design of what you want to implement using the UML notation. At the very least, you should have a use case diagram, class diagram and a sequence diagram.

  Simple java application that uses the string

Create a simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

  Write a program that prints a payroll statement

Write a program that accepts the subsequent information from the user and prints a payroll statement:

  What is the greatest common divisor

What is the greatest common divisor of the Fibonacci numbers f100 and f101 by Euclid algorithm.

  Explain at least three scenarios where he is wrong

Explain at least three scenarios where he is wrong, that is, where users other than a file's owner need some kind of allowed access privileges

  Java is considered to be safe from buffer overflows

Java is considered to be safe from buffer overflows. Does that make it more appropriate to use as a s development language when security is concerned? Be sure and weight all if the risks involved in product development, not just the security aspec..

  Advance programming hi i want two copies of the assignment

hi ltbrgti want two copies of the assignment me and my friend are doing same assignment. ltbrgtwe need both the

  Create a data set with 100 integer values.

Create a data set with 100 integer values. Create a program that uses the division method of hashing to store the data values into hash tables with table sizes of 7,,51 and 151. Use the linear probing method of collision resolution. Print out the ..

  Write a java program to register students for a college

Project is for designing and developing a College Registration program. Write a Java program to register students for a college

  Common to perform loops that vary the loop control

When an application contains an array and you want to use every element of the array in some task, it is common to perform loops that vary the loop control variable from 0 to one less than the size of the array.

  Program mimics a rudimentary spreadsheet

Change the averages so that they are rounded to the nearest one hundredth. The example above shows averages in format - Change the program so that before the spreadsheet window is displayed, the user sees the window

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