Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
5th Edition
ISBN: 9780134801155
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 11, Problem 2MC
Program Description Answer
A “decision structure” is used to perform an action, which is selected by the user from a menu.
Hence, the correct answer is option “D”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Geometry 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…
A pizza menu allows you to select 4 toppings at no extra charge from a list of 9 possible toppings. The number of ways can you select 4
toppings pizza will be
Select one:
O 84
O 126
O 36
O 256
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…
Chapter 11 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
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
Knowledge Booster
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_forwardFor each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number of days for a resort stay. Then display the price per night and the total price. Nightly rates are $200 for one or two nights; $180 for three or four nights; $160 for five, six, or seven nights; and $145 for eight nights or more.arrow_forwardCalories Burned Running on a particular treadmill, you burn 3.9 calories per minute. Create an application that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. Display the output in a ListBox control. Tuition Increasearrow_forward
- Please only the appropriate option without explanation and quicklyarrow_forwardUse relational and logical operators to make decisions using selection structure Use switch statement to design a simple menu selection decisionarrow_forwardA custom tailor offers a variety of custom suit options to customers. The company has tasked you with creating a program that will allow tailors to enter information about the kind of material used to make the customer's custom suit and the number of square yards used to make the suit and will determine the total cost to charge the customer. Use the following steps to create the program: The program should display a menu that asks the technician to select the type of material that was used. Make sure the menu is formatted exactly as in the Sample Input and Output of the instructions (including indentation). The program should determine the cost per square yard of the material. The cost per square yard is determined based on the type of material that is used. Table 1: Type of Material and Cost per Square Yard The program should then ask the tailor to enter the number of square yards of material that they used to make the custom suit. Calculate the material cost, which…arrow_forward
- True or FalseTo store items in a ListBox, you add them to the control’s Text property.arrow_forwardPerform 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_forward• 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.…arrow_forward
- Language translator python pleasearrow_forwardC Programming Your job is to create an application that will ask the user to select a choice (draw a boy, draw a girl, or draw a house). Depending on the selection then draw an image on the output screen.arrow_forwardنقطة واحدة Keywords in Visual Basic are * words that are used as prefixes for control names (such as text, btn, LBL, and Ist). is used to name controls, such as TextBox1, Command2, etc. should be used Find when naming variables. have special meaning and should not be used Find when naming variables. هذا السؤال مطلوب نقطة واحدة The default property for a text box control is Enable O Text Multiline Password char Oarrow_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,
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,