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

  Savingsaccount and bankaccount objects

The only differences between SavingsAccount and BankAccount objects is that SavingsAccount have an interest rate and can compute interest when necessary. Add an instance variable and a method to SavingsAccount to allow for these items.

  Create to determine how much either joe or jim

What type of equation would you create to determine how much either Joe or Jim makes separately? What equation is needed in Java (ignoring the $ symbol)? What data type is needed need for this equation?

  Project detailsyou will explore basic socket programming

project detailsyou will explore basic socket programming threading and gui design using javas network library threading

  Problems related to java programming

Create a Java program to do the following: - Open the text file you downloaded. - Read each record.

  Write program with jframe to enter series of names

Write a program with JFrame which permits user to enter series of friends' names and phone numbers and creates file from entered data.

  Program designs used in developing java applications

program designs used in developing Java applications

  Explain the inventory program to include an add button

Modify the Inventory Program to include an add button, a delete button, and a modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock

  Write a jsp webpages ask the user to enter data

Write a jsp webpages ask the user to enter the following data- First name, Last name

  Number of primes

Write a program BackwardPrimes.java that prompts user for a positive integer number x and displays x prime numbers whose reversal is also a prime. Numbers 13, 31 and 157 are instances of such numbers. Following is a sample run of your program.

  Prepare a main method that tests all of your functions

A method that outputs the name and list of all patients - A method that resets the number of patients to 0 and the patientList to an empty list - Prepare a main method that tests (i.e, unit testing) all of your functions.

  Implement a card game in java

In this assignment, you will be asked to implement a card game. You will need to make several design decisions for your code. It will be expected that all classes you write will utilize the principle of encapsulation.

  Calculate the percent of kcal from each macronutrient

Calculate the percent of kcal from each macronutrient and the percent of kcal by fluids.

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