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
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...
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...
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...
Write the following problem in Java Create a class Dog, add name, breed, age, color as...
Write the following problem in Java Create a class Dog, add name, breed, age, color as the attributes. You need to choose the right types for those attributes. Create a constructor that requires no arguments. In this constructor, initialize name, breed, age, and color as you wish. Define a getter and a setter for each attribute. Define a method toString to return a String type, the returned string should have this information: “Hi, my name is Lucky. I am a...
Java project// please explain every statement with reasoning. Thank you Mary had a little lamb whose...
Java project// please explain every statement with reasoning. Thank you Mary had a little lamb whose fl33ce was white as sn0w And everywhere that @Mary went the 1amb was sure to go. Read from a file that contains a paragraph of words. Put all the words in an array, put the valid words (words that have only letters) in a second array, and put the invalid words in a third array. Sort the array of valid words using Selection Sort....
This program is in C++: Write a program to allow the user to: 1. Create two...
This program is in C++: Write a program to allow the user to: 1. Create two classes. Employee and Departments. The Department class will have: DepartmentID, Departmentname, DepartmentHeadName. The Employee class will have employeeID, emploeename, employeesalary, employeeage, employeeDepartmentID. Both of the above classes should have appropriate constructors, accessor methods. 2. Create two arrays . One for Employee with the size 5 and another one for Department with the size 3. Your program should display a menu for the user to...
Write a Java program to display a letter grade based on an actual grade. USING ECLIPSE...
Write a Java program to display a letter grade based on an actual grade. USING ECLIPSE IDE A = 90-100 B = 80-89 C = 70-79 D = 60-69 F = less than 60 The program needs to do the following: 1. Create a short integer to store a grade. (See Week 3 - Things to Know - Java Data Types ) 2. Prompt for a grade ( 0-100). 3. Based on the grade given, use IF statements to display...
Write a 4-6 sentence summary explaining how you can use STL templates to create real world...
Write a 4-6 sentence summary explaining how you can use STL templates to create real world applications. In your summary, provide an example of a software project that you can create using STL templates and provide a brief explanation of the STL templates you will use to create this project. After that you will implement the software project you described . Your application must be a unique project and must incorporate the use of an STL container and/or iterator and...
Hello, I am having trouble getting my files to work together for this problem. Here is...
Hello, I am having trouble getting my files to work together for this problem. Here is the question and thank you for taking the time to answer it :) (1) Write an application that displays a menu of three items for the Jivin’ Java Coffee Shop as follows: American 1.99 Expresso 2.50 Latte 2.15 Prompt the user to choose an item using the number (1, 2, or 3) that corresponds to the item, or to enter 0 to quit the...
*In Java Please RECURSION Objectives • Learn the basics of recursion – Part II (last week...
*In Java Please RECURSION Objectives • Learn the basics of recursion – Part II (last week was Part I) Submission Guidelines: You will turn in 2 program files (one for each lab problem) Tasks This lab has two parts: 1. Write a recursive method repeatNTimes(String s, int n) that accepts a String and an integer as two parameters and returns a string that is concatenated together n times. (For example, repeatNTimes ("hello", 3) returns "hellohellohello") Write a driver program that...