Question

Problem Statement: Write a Java program “HW6_lastname.java” that prints a program title and a menu with...

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

                      

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please make a Java program that has a menu method and includes dialog boxes. The program...
Please make a Java program that has a menu method and includes dialog boxes. The program will call the proper method, but each method will be completed later. Your program will keep track of information for a Hospital. The program will be menu-driven. Your menu is to look something like the following: UPMC Medical Center Add/Modify Patient Information Add/Modify Physician Information Add/Modify Medical Information Hospital Report Section Exit the Medical System Please Make your selection > In this first phase,...
Write a program in Java that: 1. will prompt user with a menu that contains options...
Write a program in Java that: 1. will prompt user with a menu that contains options to: a. Add a To-Do Item to a todo list. A To-Do Item contains: i. An arbitrary reference number (4; 44,004; etc.) ii. A text description of the item ("Pick up dry cleaning", etc.) iii. A priority level (1, 2, 3, 4, or 5) b. View an item in the list (based on its reference number) c. Delete an item from the list (based...
Write a Java program using the OOP paradigm to do the following: 1. Main Function: create...
Write a Java program using the OOP paradigm to do the following: 1. Main Function: create a list with a million items, and you can use the generate function to add a million random values to the list. 2. Create a method to sort the list created in the main function using bubble sort, then use the sorted list to search for the (k) value using binary search. 3. Create a method to create a new list of 1000 items...
Write a program that reads a file named input.txt and writes a file that contains the...
Write a program that reads a file named input.txt and writes a file that contains the same contents, but is named output.txt. The input file will contain more than one line when I test this. Do not use a path name when opening these files. This means the files should be located in the top level folder of the project. Do not use a copy method that is supplied by Java. Your program must read the file line by line...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
C programming 1. Create a file function.c that contains a function called printNumbers() that prints the...
C programming 1. Create a file function.c that contains a function called printNumbers() that prints the numbers 1 to 15. 2. Create a file function.h that contains the prototype for the printNumbers() function. 3. Create a file main.c that contains a main function that calls the printNumbers() function. You will need to be sure to include the header file. 4. Use gcc to compile the entire program (all files) without warnings. 5. Run the program and make sure that it...
Objective: Write a Java program that will use a JComboBox from which the user will select...
Objective: Write a Java program that will use a JComboBox from which the user will select to convert a temperature from either Celsius to Fahrenheit, or Fahrenheit to Celsius. The user will enter a temperature in a text field from which the conversion calculation will be made. The converted temperature will be displayed in an uneditable text field with an appropriate label. Specifications Structure your file name and class name on the following pattern: The first three letters of your...
Program using java !! Create two files, file1.csv and file2.csv Write the following information in file1.csv:...
Program using java !! Create two files, file1.csv and file2.csv Write the following information in file1.csv: Apple 1.69 001 Banana 1.39 002 Write the following information in file2.csv: Apple 1.69 001 Carrot 1.09 003 Beef 6.99 004 You have two files, both of the two files have some information about products: • Read these two files, find out which products exist in both files, and then save these products in a new file. You can use the two files you...
This is a Java program Program Description You work for a local cell phone company and...
This is a Java program Program Description You work for a local cell phone company and have been asked to write a program to calculate the price of a cell phone data plan being purchased by a customer. The program should do the following tasks: Display a menu of the data plans that are available to be purchased. Read in the user’s selection from the menu.  Input Validation: If the user enters an invalid option, the program should display an error...
JAVA PROGRAMMING: Write a program called TimeSymbolTables that creates three symbol tables, each of a different...
JAVA PROGRAMMING: Write a program called TimeSymbolTables that creates three symbol tables, each of a different implementation. Each symbol table will contain as a key a word read from a text file and as a value the number of times that word occurs in the text file. Have the program fill the first symbol table with these counts, keeping track of how long that takes using a Stopwatch object. It then does the same thing with the second symbol table....
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT