Write a java program to calculate the letter grades of each


Q - Write a java program to calculate the letter grades of each student in the class based on the scale shown on the course overview and the syllabus. Which type of decision structure would be best for this and why? and which statement would you use? If, if-then, if-then-else, switch, others?

A - Figure out how to use the switch statement because it evaluates the variable and jumps directly to the case for that value, but in this example you have a range of values (i.e. 90-100) for an A, you can't use the switch statement you have to use the if-then-else statement.

Example Calculating letter grades

import java.util.Scanner;

public class template

{

public static void main (String[] args)

{

Scanner keyboard = new Scanner (System.in);

double grade; //assign value to grade variable

System.out.print ("Enter grade in number value 1-100 ");

grade = keyboard.nextDouble();

if (grade >=90)

System.out.println ("A");

else if (grade >=80)

System.out.println ("B");

else if (grade >=70)

System.out.println ("C");

else if (grade >=60)

System.out.println ("D");

else if (grade <60)

System.out.println ("F");

} // end main

} // end class template 

Criteria - Write one or two paragraphs. Provide valuable and thoughtful feedback for the above answer with constructive criticism and critiques. Present original thoughts and ideas in postings, (avoid simple agreement or disagreement with, or restatement of other's postings) You may want to provide additional information from your outside readings or other outside resources. I encourage you to share links to other excellent resources during this course. 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a java program to calculate the letter grades of each
Reference No:- TGS0124979

Expected delivery within 24 Hours