Program that translates a letter grade into a number grade

Assignment Help JAVA Programming
Reference no: EM13940561

Write a Java program that translates a letter grade into a number grade. Letter grades are A B C D F, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F-. A + increases the numeric value by 0.3, a - decreases it by 0.3. However, an A+ has the value 4.0. All other inputs have value -1.

A sample session could look like following.

Enter a letter grade:
B-
Numeric value: 2.7.

Write a class Grade with a method getNumericGrade.

Use the following class as your main class:

import java.util.Scanner;

/**
This class prints the numeric value of a letter grade given by the user.
*/
public class GradePrinter
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Enter a letter grade:");
String input = in.nextLine();
Grade g = new Grade(input);
double grade = g.getNumericGrade();
System.out.println("Numeric value: " + grade);
}
}

Reference no: EM13940561

Questions Cloud

Identify individual and relationship functioning : Identify individual and relationship functioning, Integrate client assessment and observational data with to formulate a conceptualization and What is a good treatment plan.
Determine the stress in each material : If the member carries a compressive load of 20 kN, determine the stress in each material and the overall change in length.
Quality of reporting in terms of the global report : Assesses the quality of reporting in terms of the global report Initiative's G4 (2013) criteria (i.e. balance, comparability, accuracy, timeliness, clarity and reliability, including assurance).
Shares of warner company : Larsen Company purchased 13,500 shares of Warner Company for $162,000 plus a broker's fee of $4,400. Warner Company has a total of 67,500 shares of common stock outstanding and it is presumed the Larsen Company will have a significant influence over ..
Program that translates a letter grade into a number grade : Write a Java program that translates a letter grade into a number grade
Based on the numbers from your individual project : Based on the numbers from your Individual Project, do you feel that the manager of S&J Plumbing, Incorporated has delivered a good profit margin? Support your argument?
Analyze and describe the concept of jury nullification : In 1984, the Supreme Court ruled that in order to establish ineffectiveness of counsel, a defendant must prove that two constitutional standards were violated. Discuss what these two standards are and how they establish ineffectiveness of counsel.
Designing an effective electrical safety program : Several regulations and standards must be considered when designing an effective electrical safety program. OSHA has a series of regulations under Subpart S dealing with electrical systems
Translate strategic goals and objectives : 'If effective operations management is to  translate strategic goals and objectives into action, whist ensuring continuity of supply of products and services to customers, then it is imperative that the key characteristics of strategies employed  ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Define a simple interface named motorized with one method

question 1 define a simple interface named motorized with one method maxspeed which returns the maximum attainable

  Prepare address book java application

Prepare an application that reads the contents of your address book file and prepare a user guide that includes a description of the functionality of your overall address book system.

  Write java programming to show number of credits for course

Write the java programming to solve following problem. We are given a student's marks in Calculus 1, CS1, and Physics 1 (each mark being between 0 and 100) also number of credits for each course.

  Design and implement a small and simple email server using

design and implement a small and simple email server using the concept of web based information system wbis. your

  Technical community blog

Write a blog article for a coding/technical community blog

  The api for this class ispublic void poweronnbsp sets the

the api for this class ispublic void poweronnbsp sets the machine ready to serve the selected ice creampublic void

  Accepts a string as its parameter and returns an integer

Write a method in java named secondHalfLetters that accepts a string as its parameter and returns an integer representing how many of letters in the string come from the second half of the alphabet

  How are java source code files named

What is the purpose of the wait(), notify(), and notifyAll() methods? How are Java source code files named?

  Bulloil company is planning a large pipeline from east to

bulloil company is planning a large pipeline from east to west x-axis across its oil fieldbullthe field has n

  Controlling and using the paintcomponent ( ) method

How to paint the screen -Controlling and using the paintComponent ( ) method Deliverables app.java, myJFrame.java, myJPanel.java,  and other necessary Java files

  Summary of the case astrazeneca-unitedhealth

What is the summary of the case "AstraZeneca, UnitedHealth, and Others: IT-Asset Management- Do you know what youv've got?"

  Java programming arrays

Write a Java application program that takes in user input from keyboard and calculate semester grade based on the scores. In this assignment, you are going to rewrite the program, instead of taking keyboard input, you will use dialog box to prompt..

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