STARTING OUT W/PROGRAM.LOGIC...-TEXT
5th Edition
ISBN: 2810022369454
Author: GADDIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 11, Problem 7MC
When the user selects an operation from a(n) _____,the
- a. multiple-level menu
- b. single-level menu
- c. submenu
- d. interleaved menu
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
# Constants for the menu choices# Constants for the menu choicesPURCHASE_ADULT = 1PURCHASE_CHILD = 2PURCHASE_MOUSE_EARS = 3PURCHASE_PARKING = 4PURCHASE_FOOD = 5PRINT_ALL = 6CALC_TOTAL = 7QUIT_CHOICE = 8# The main function.def main():# The choice variable controls the loop# and holds the user's menu choice. choice = 0 costAdult=0 costKid=0 costEars=0 costPark=0 costFood = 0 while choice != QUIT_CHOICE:# display the menu. display_menu()# Get the user's choice. choice = int(input('Enter your choice: '))# Perform the selected action. if choice == PURCHASE_ADULT: costAdult = purchaseAdult() elif choice == PURCHASE_CHILD: costKid = purchaseKid() elif choice == PURCHASE_MOUSE_EARS: costEars = purchaseEars() elif choice == PURCHASE_PARKING: costPark = purchaseParking(); elif choice == PURCHASE_FOOD: costFood…
Menu of the Day
Create a program that filters and displays the correct menu items based on the day that the user enters.
Console
Menu of the Day
COMMAND MENU
Specify the day using the three-letter format (mon, tue, wed, thu, fri, sat, sun). Or, enter 'exit' to exit.
Day: mon
Roast beef 10
Potato soup 6
Baked cod 10
Day: tue
Butter chicken 11
Lamb tikka 12
German forest cake 7
Day: exit
Bye!
Specifications
A tab-delimited text file named menu.txt that contains the menu items for the current week is attached. Each item has a name (a string), price (an integer), and associated day (a string)
Use a structure named MenuItem to store the name, price, and day for each menu item.
When the program starts, it should load the items from the file into a vector of MenuItem objects.
The user should be able to type a three-letter day code to display the menu items for the specified day.
The user should be able to…
• Create the Main Menu calculator
o Have it display the 4 choices.
o Accept user choices.
o Display the selection made.
o The program will loop until the "Exit" option
is selected.
• Create the Trim Molding calculator
o Ask for the total number of walls in a room
o Ask each wall's length (use a loop),
o Calculate the amount of trim needed.
o Display the number of trim pieces needed
• Create the Carpet calculator
o Ask for the length, and width of the room
o Calculate the number of carpet tiles needed
o Display the number of tiles needed
Create the Ceiling Tile calculator
o Ask for the length, and width of the room
o Asked for the tile size to be used.
o Calculate the number of tiles needed
●
■ If the length of the room is not divisible
by the length of the tile, you will need
an additional tile to complete the job.
if(room Length % tileLeanght !=0)
then tileL++;
■ If the width of the room is not divisible
by the width of the tile, you will need an
additional tile to complete the job.…
Chapter 11 Solutions
STARTING OUT W/PROGRAM.LOGIC...-TEXT
Ch. 11.1 - What is a menu-driven program?Ch. 11.1 - The items displayed in a menu are often preceded...Ch. 11.1 - What type of structure do you use in a program to...Ch. 11.3 - Explain why most menu-driven programs use a loop...Ch. 11.3 - If a program uses a loop to display a menu...Ch. 11.4 - Prob. 11.6CPCh. 11.4 - Prob. 11.7CPCh. 11.4 - When a program has a lot of items for the user to...Ch. 11 - Prob. 1MCCh. 11 - Prob. 2MC
Ch. 11 - If a menu-driven program uses a loop to redisplay...Ch. 11 - A program that uses a multiple-level menu displays...Ch. 11 - Prob. 5MCCh. 11 - When the user selects an operation from a...Ch. 11 - When the user selects an operation from a(n)...Ch. 11 - Prob. 1TFCh. 11 - It is not usually necessary to validate the user's...Ch. 11 - In most cases, a menu-driven program should be...Ch. 11 - If a menu-driven program does not use a loop to...Ch. 11 - In a single-level menu, the user might see a...Ch. 11 - What type of structure do you use in a program to...Ch. 11 - What ways for validating a users menu selection...Ch. 11 - How can you design a menu-driven program so that...Ch. 11 - When a program has a lot of items for the user to...Ch. 11 - Prob. 1AWCh. 11 - Design a case structure that can be used with the...Ch. 11 - Put the algorithms that you designed for questions...Ch. 11 - Look for ways to modularize the algorithm that you...Ch. 11 - Language Translator Design a program that displays...Ch. 11 - Prob. 2PECh. 11 - Prob. 3PECh. 11 - Astronomy Helper Create an application that...Ch. 11 - Golf Score Modification In Programming Exercise 6...Ch. 11 - Phone Book Program Design a program that you can...Ch. 11 - Prob. 7PE
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
?.1 Define the different reference meridians that can be used for the direction ofa line.
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Find the no-load value of υo in the circuit shown.
Find υo when RL is 150 Ω.
How much power is dissipated in th...
Electric Circuits. (11th Edition)
What is the output produced by the following Java code:
Java: An Introduction to Problem Solving and Programming (8th Edition)
T F Array names cannot be dereferenced with the indirection operator.
Starting Out with C++ from Control Structures to Objects (9th Edition)
When displaying a Java applet, the browser invokes the _____ to interpret the bytecode into the appropriate mac...
Web Development and Design Foundations with HTML5 (8th Edition)
What are the advantages and disadvantages of a four-jaw independent chuck versus a three-jaw chuck?
Degarmo's Materials And Processes In Manufacturing
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 44% 2:34 PM Theme Park Ticket Application In holidays, people try to save their time and purchase entrance tickets of the favored theme parks online. This project aims to create a simple and most efficient application that will display a menu to the visitors which contains: 1. Book a ticket The program will display a menu that contains all the ticket prices below, get how many tickets he/she would like to buy, and displays the total price. The ticket Price Child - Under 8 years old 70 USD Adults 110 USD Seiners 50 USD 2. Calculate the price The program should calculate the total price of tickets and display it to the visitor. The program will ask if the visitor is a student, then a discount of 40% is applied to the total price. 3. Exit the application The application should be terminatedarrow_forwardThe horizontal line in a menu is called _____. a menu bar a separator bar an item separator None of the above.arrow_forwardA menu is generated using the following code: Status=menu('ClassStanding','Freshman','Sophomore','Junior','Senior'); Write a segment of code using switch-case that will classify the person making a menu selection as a new student (freshman) or a continuing student (sophomore, junior, or senior). The code should display one of the following messages: You are a new student. You are a continuing student. You did not make a selection.arrow_forward
- Case1: Write a menu driven program that allows you to visit cities of oman in random order with following options. 1: Visit a city 2: Go to previous city 3: Quit the program When user presses 1: program asks user to enter the city name, and then display that the city has been visited. Please note user can visit a city any number of times When user presses 2: Program takes you back to the previous city When user presses 3: Program terminates See the below example how program interacts with the user: C:> 1: Visit a city2: Go to previous city3: Quit the program Enter your choice … 1 Please enter a city to visit.. Muscat You are in Muscat now… Enter your choice... 1: Visit a city2: Go to previous city3: Quit the program 1 Please enter a city to visit.. Ibra You are in Ibra now… Enter your choice... 1: Visit a city2: Go to previous city3: Quit the program 1 Please enter a city to visit.. Sohar You are in Sohar now… Enter your choice... 1: Visit a city2: Go to…arrow_forwardPlease only the appropriate option without explanation and quicklyarrow_forwardCreate a program that repeatedly displays a menu as a prompt, inputs the user’s choice and takes the correct action based on which menu option was selected. If the user made an invalid selection, the program should tell them. The menu options should be: 1 – Convert miles to kilometers 2 – Convert kilometers to miles 3 – Exit the program Actions for each option: 1 – Convert miles to kilometers Ask the user to enter a distance in miles Convert the value entered to kilometers Display the conversion from/to ????????????????????= ?????????? × 1.60934 2 – Convert kilometers to miles Ask the user to enter a distance in kilometers Convert the value entered to miles Display the conversion from/to ??????????= ???????????????????? × 0.621371 3 – Exit the program Display a message that the program is exiting Stop the loop The program should repeat the menu after options 1 and 2. Use OnlineGDB.arrow_forward
- Perform Student Controlthat you have the menu where you first enter the names of the studentsenter the names of the coursesthat averages the courses per studentto display on the screen the entered students, the courses and their options, scores and whether or not they were promoted. And create a class called teacherarrow_forwardCalculations: • Main Menu - None • Trim Molding - (length ++) / 8; add the length based on the number of walls needed then divide by 8 feet Carpet - (length * width) / 4; multiply the length and width of the room (in feet) then divide by 4 sq feet (covered by each carpet tile) ● ● Ceiling Tile o roomLength / tileLeanght tileL; o If the length of the room is not divisible by the length of the tile, you will need an additional tile to complete the job. if( roomLength % tileLeanght !=0) then tileL++; o room Width /tileWidth = tileW; o If the width of the room is not divisible by the width of the tile, you will need an additional tile to complete the job. if(room Width % tileWidth !=0) then tileW++; o totalTiles = tileW * tileL; Deliverables: = A flowchart for the main menu and each of the task- specific calculators will be created and delivered in PDF format (4 PDF files). A.java file will be created for the main menu and each of the task-specific calculators (4 .java files).arrow_forward1- From a main menu, it should only take at most to perform an action. a) O Three mouse clicks or keystrokes b) O Four mouse clicks or keystrokes c) O Six mouse clicks or keystrokes d) O Five mouse clicks or keystrokes e) O Depends on the complexity of the system interface and experience of the usersarrow_forward
- Create starting menu using Pythonarrow_forwardIn the 1850's, the hottest new technology was the telegraph. Messages or telegrams could be sent via electrical forces traveling through a wire. Write a program that will generate a bill for sending a telegram and give the user the opportunity to translate a message into Morse code. The amount owed for sending a telegram is based on the number of words sent. Customers are charged at a rate of $1.50 for blocks of 5 words and $0.50 for single words. Named constants must be used in the calculation. For now, your program will only translate a single letter into Morse code. In the next project, you will add the functionality to translate an entire message. Use the tables below to translate letters into Morse code. Letter Encoding A, a B, b C, c D, d E, e F, f G, g H, h I, i -.-. Letter Encoding J, j K, k L, 1 M, m N, n 0,0 P, p Q, q R, r -- Letter Encoding S, s T, t U, u V, V W, W X, X Y, Y Z, Z -..- --- Get Helparrow_forwardGeometry Calculator Write a program that displays the following menu: Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1-4): If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the following formula: area = Pi*r^2 Use 3.14159 for and the radius of the circle for r. If the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. Use the following formula: area = length * width If the user enters 3 the program should ask for the length of the triangle’s base and its height, and then display its area. Use the following formula: area = base * height * .5 If the user enters 4, the program should end. Input Validation: Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. Do not accept negative values for…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Graphical User Interfaces: Crash Course Computer Science #26; Author: CrashCourse;https://www.youtube.com/watch?v=XIGSJshYb90;License: Standard YouTube License, CC-BY
Python GUI | How To Make A GUI In Python | Best GUI Framework In Python | Edureka; Author: edureka!;https://www.youtube.com/watch?v=_PHJvjQJa3w;License: Standard Youtube License