Answered You can buy a ready-made answer or pick a professional tutor to order an original one.
Write a Java program as follows:1. Prompt the user on which action they want to take:a. Convert cubic feet to U.S. bushelsb. Convert miles to kilometersc. Determine graduation with honors titled. Exit
Write a Java program as follows:1. Prompt the user on which action they want to take:a. Convert cubic feet to U.S. bushelsb. Convert miles to kilometersc. Determine graduation with honors titled. Exit program2. Programs at a minimum must have the following methods:a. Convert cubic feet method that gets cubic feet and returns U.S. bushels.b. Convert to kilometers method that gets miles and returns kilometersc. Determine graduation with honors title method that gets GPA and returnshonors title value (category)
- @
- ANSWER
import java.util.Scanner;
public class Javaprogram {
public static void main(String []args) {
Scanner keyboard = new Scanner(System.in);
double miles;
double cubic;
double gpa ;
while(true) {
System.out.println("a. Convert cubic feet to U.S. bushels");
System.out.println("b. Convert miles to kilometers");
System.out.println("c. Determine graduation with honors title");
System.out.println("d. Exit program");
System.out.print("Your option : ");
String option = keyboard.next();
switch(option) {
case "a" :
System.out.print("Enter cubic foot: ");
cubic = keyboard.nextDouble();
cubicfeet (cubic);
break;
case "b" :
System.out.print("Enter Miles: ");
miles = keyboard.nextDouble();
convkilometers (miles);
break;
case "c" :
System.out.println("Enter GPA");
gpa = keyboard.nextFloat();
graduation (gpa);
break;
case "d" :
System.out.println("Program Exited.");
keyboard.close();
System.exit(0);
break;
default :
System.out.println("Invalid input");
}
}
}
public static void cubicfeet (double cubic) {
System.out.println(cubic +" cubic feel is "+ cubic *0.803564 +" U.S. bushel\n");
}
public static void convkilometers (double miles) {
System.out.println(miles +" miles is "+ miles *1.60934 +" Km\n");
}
public static void graduation (double gpa) {
if(gpa >= 3.5 && gpa <= 3.7) {
System.out.println("CumLaude\n");
}
else if(gpa >=3.8 && gpa <= 3.9) {
System.out.println("MagnaCumLaude\n");
}
else if(gpa >= 4) {
System.out.println("SummaCumLaude\n");
}
}
}