Problem Statement: Write a Java program “HW6_lastname.java” that prints a program title and a menu with four items. The user should then be prompted to make a selection from the menu and based on their selection the program will perform the selected procedure.
The title and menu should be as the following:
Student name: <your name should be printed>
CIS 232 Introduction to Programming
Programming Project 6
Due Date: October 23, 2020
Instructor: Dr. Lomako
********************************
1. Compute Angles *
2. Lottery Using Strings *
3. Order Two Cities *
4. Exit. *
********************************
Enter the number of selection:
Help:
1. Run and study the OrderTwoCities.java, LotteryUsingStrings.java, and ComputeAngles.java files. Include their descriptions in your report.
Use the programming project HW5 solution as an initial class file for your project.
To implement the menu items create three methods:
ComputeAngles
LotteryUsingStrings
OrderTwoCities
Use ComputeAngles.java file statements to create ComputeAngles method.
Use LotteryUsingStrings.java file statements to create LotteryUsingStrings method.
Use OrderTwoCities.java file statements to create OrderTwoCities method.
You do not need to copy all statements from java files to the method bodies, but carefully decide what statements you need to use.
The switch case body should have the method call only:
1. Use the case 1 body statements to call “ComputeAngles” method
2. Use the case 2 body statements to call “LotteryUsingStrings” method
3. Use the case 3 body statements to call “OrderTwoCities” method
Here is the code with the provided information, please share the following file to implement the method :
1. ComputeAngles.java
2. LotteryUsingStrings.java
3. OrderTwoCities.java
HW6_lastname.java
import java.util.Scanner;
public class HW6_lastname {
private static final Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("Student name: "+"JohnDoe");
System.out.println("CIS 232 Introduction to Programming\nProgramming Project 6\nDue Date: October 23, 2020\nInstructor: Dr. Lomako");
System.out.println("********************************");
System.out.println("1. Compute Angles *");
System.out.println("2. Lottery Using Strings *");
System.out.println("3. Order Two Cities *");
System.out.println("4. Exit. *");
System.out.println("********************************");
while (true){
System.out.println("Enter the number of selection: ");
int choice = sc.nextInt();
switch (choice){
case 1 : ComputeAngles();
break;
case 2 : LotteryUsingStrings();
break;
case 3 : OrderTwoCities();
break;
case 4 : sc.close();
return;
default:
System.out.println("Invalid choice, please try selecting again.");
}
}
}
private static void OrderTwoCities() {
}
private static void LotteryUsingStrings() {
}
private static void ComputeAngles() {
}
}
Will update the answer once the required files are provided. Also please don't forget to upvote the solution if it helped you in some way.
Thank you.
Get Answers For Free
Most questions answered within 1 hours.