Question

I am needing help with the last part of this code. I have gotten each part...

I am needing help with the last part of this code. I have gotten each part working correctly accept getting the menu options to work by input and getting to the right section. your help is appreciated. I am to the menu in the code is the display menu and need an loop to interact until they want to exit menu. The edit options only needs an output of "feature is not yet implemented."

Due to length I did not include all the code, only the part of the code needing help. I will adjust variable names to match what is in the code classes. Thank you for the assistance.

// display text-based menu
public static void printDisplayMenu() {

System.out.println("\n\n");
System.out.println("\t\t\tLuxury Ocean Cruise Outings");
System.out.println("\t\t\t\t\tSystem Menu\n");
System.out.println("[1] Add Ship [A] Print Ship Names");
System.out.println("[2] Edit Ship [B] Print Ship In Service List");
System.out.println("[3] Add Cruise [C] Print Ship Full List");
System.out.println("[4] Edit Cruise [D] Print Cruise List");
System.out.println("[5] Add Passenger [E] Print Cruise Details");
System.out.println("[6] Edit Passenger [F] Print Passenger List");
System.out.println("[x] Exit System");
System.out.println("\nEnter a menu selection: ");
  

  
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Following is the answer:

String choice;

do{

printDisplayMenu();

choice = scanner.next();

}while(choice != "x");

This code prints menu until x is not entered.

Add a comment
Know the answer?
Add Answer to:
I am needing help with the last part of this code. I have gotten each part...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • NOTE: I ONLY NEED THE CODE FOR THIS PART: "3 - add movie and category to...

    NOTE: I ONLY NEED THE CODE FOR THIS PART: "3 - add movie and category to list for an entered year". YOU DON'T HAVE TO GIVE ME THE CODE FOR MENU OPTIONS 1, 2, pc, p, OR q BECAUSE I HAVE THAT ALREADY. ONLY 3! EDIT: THIS IS FOR PYTHON 3.8. In this assignment you are to enhance the movie list display program from Assignment 4 to help maintain a list of movies that won the Academy Award (Oscar) for...

  • Need help writing this code in python. This what I have so far. def display_menu(): print("======================================================================")...

    Need help writing this code in python. This what I have so far. def display_menu(): print("======================================================================") print(" Baseball Team Manager") print("MENU OPTIONS") print("1 - Calculate batting average") print("2 - Exit program") print("=====================================================================")    def convert_bat(): option = int(input("Menu option: ")) while option!=2: if option ==1: print("Calculate batting average...") num_at_bats = int(input("Enter official number of at bats: ")) num_hits = int(input("Enter number of hits: ")) average = num_hits/num_at_bats print("batting average: ", average) elif option !=1 and option !=2: print("Not a valid...

  • C++ Code error help. I am getting the error: "expression must have a constant value, the...

    C++ Code error help. I am getting the error: "expression must have a constant value, the value of parameter 'n' ( declared at line 7) cannot be used as a constant" I am also getting this error at lines 65 and 66 with m and n. I do not know how to fix this. Here is my code and ive marked where the errors were with lines: #include<iostream> using namespace std; // Function to allocate memory to blocks as per...

  • Please help in C: with the following code, i am getting a random 127 printed in...

    Please help in C: with the following code, i am getting a random 127 printed in front of my reverse display of the array. The file i am pulling (data.txt) is: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 when the reverse prints, it prints: 127 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 not sure why...please...

  • I am needing help visualizing this problem. I 'think' I have the answer correct, but am...

    I am needing help visualizing this problem. I 'think' I have the answer correct, but am not sure if I truly understand the question. The question is asking for the electric field. Is this the only equation with electric field or are there others? E = F/q F = 2.00x10-5 N q = -1.75µC (which converts to -1.75x10-6C) E = 2.00x10-5 N / -1.75x10-6C = -1.14x10-11 N/C ? E = -1.14x10-11 N/C ? Question: What is the magnitude and direction...

  • I am needing to code a coffee mug in OpenGL using c++. I have found the coding for a tea kettle b...

    I am needing to code a coffee mug in OpenGL using c++. I have found the coding for a tea kettle but we have been told we cannot use a tea kettle. I have attached a photo for reference. Thank you for any help you can provide!

  • Can someone help me fill in the first part of this c++ code: I need it...

    Can someone help me fill in the first part of this c++ code: I need it to print the menu based on the day selected. #include #include using namespace std; int main(){ double sub_total=0,tax=0,total=0; string food1[3]={"T-Bone Steak","Pork Chops","Iceland Cod"}; double prices_f1[]={20.50,15.45,10.55}; string food2[3]={"Sirloin Steak","Salmon Fillet","Jumbo Shrimp"}; double prices_f2[]={30.35,24.50,15.50}; string food3[3]={"Pork Tenderloin","Buffalo Chicken Sandwhich","Avocado Burger"}; double prices_f3[]={10.60,15.60,25.60}; string drink1[3]={"Raspberry Sgroppino","Sparkling Apple Sangria ","Spiced Cranberry Rum"}; double prices_d1[]={2.55,5.75,4.25}; string drink2[3]={"Champagne Mojitos","Roman Hoilday Cocktail","Dry Martini"}; double prices_d2[]={1.5,3,25,8.45}; string drink3[3]={"Radler Beer","Port wine","Primm's"}; double prices_d3[]={3.55,2.25,4.45};...

  • I cannot submit my entire project due to the word count limit. I think my project...

    I cannot submit my entire project due to the word count limit. I think my project looks ok, but my recipe box class and recipe test class is running errors and it may have something to do with the menu portion of the recipe box. Please take a look: "You will create a program that will help you manage a collection of recipes. You will implement three classes: one for the main recipe items, one for the ingredients that are...

  • C++ HELP I need help with this program. I have done and compiled this program in...

    C++ HELP I need help with this program. I have done and compiled this program in a single file called bill.cpp. It works fine. I am using printf and scanf. Instead of printf and scanf use cin and cout to make the program run. after this please split this program in three files 1. bill.h = contains the class program with methods and variables eg of class file class bill { } 2. bill.cpp = contains the functions from class...

  • I have added a little Code but I need help with the rest. /** A class...

    I have added a little Code but I need help with the rest. /** A class of stacks whose entries are stored in a chain of nodes. Implement all methods in MyStack class Main Reference : text book or class notes Do not change or add data fields */ package PJ2; public class MyStack<T> implements StackInterface<T> {    // Data fields    private Node<T> topNode; // references the first node in the chain    private int numberOfEntries;       public...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT