The C++ code in Figure 6-39 should display one of the four messages listed in the figure.
Question:
The C++ code in Figure 6-39 should display one of the four messages listed in the figure. The appropriate message is based on the level entered by the user. Correct the errors in the code.
» level; switch (level) { case 1: case 2: cout" style="" class="fr-fic fr-dib">
Transcribed Image Text:
Level 1 or 2 Message Bronze 3 Silver 4 or 5 Gold Other Invalid ID int level = 0; %3D cout « "Level (1 through 5): "; cin >» level; switch (level) { case 1: case 2: cout <« "Bronze"; case 3: break; cout <« "Silver"; case 4: cout « "Gold"; case 5: break; default: cout <« "Invalid ID"; //end switch Figure 6-39
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 90% (11 reviews)
int level 0 cout Level 1 through 5 cin level ...View the full answer
Answered By
Muhammad Ghyas Asif
It is my obligation to present efficient services to my clients by providing a work of quality, unique, competent and relevant. I hope you have confidence in me and assign me the order and i promise to follow all the instructions and keep time.
4.60+
109+ Reviews
203+ Question Solved
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Question Posted:
Students also viewed these Computer science questions
-
Use the code shown in Figure 6-34 to answer What will the code in Figure 6-34 display when the id variable contains the number 2? a. Janet b. Jerry c. Mark d. Sue switch (id) { case 8: cout < <...
-
Use the code shown in Figure 6-34 to answer What will the code in Figure 6-34 display when the id variable contains the number 4? a. Janet b. Jerry c. Mark d. Sue switch (id) { case 8: cout < <...
-
Use the code shown in Figure 6-34 to answer What will the code in Figure 6-34 display when the id variable contains the number 9? a. Janet b. Jerry c. Mark d. Sue switch (id) { case 8: cout < <...
-
Discuss the salient features of the international monetary system.
-
Let a1, a2, a3,..., an,... be an arithmetic sequence. In Problems 9-14, find the indicated quantities 10. a1 = - 2; d = -3 ; a2 = ?; a3 = ? 12. a1 = 8; d = - 10;a15 = ?;S23 = ? 14. a1 = 203; a30 =...
-
Refer to the information for Fairfield Blues presented in Exhibit 12-5, rows 1-12. Assume that you have some new information about costs and activities for next year. Namely, you learn that the cost...
-
Explain why the systems approach is necessary to manage projects. LO6
-
Discuss why in some circumstances it is appropriate to use the randomized complete block design. Give an example other than those discussed in the text in which this design could be used.
-
The Longhom Company has four deparmentsIn factory with two service departments S1 and 52, and two production departments. P1 and 12 each of which produces a single product the ob of each depot...
-
In the current year, Ms. Patel is provided with a vehicle leased by her employer, Everex Ltd. The vehicle originally cost $30,000 and was leased by Everex Ltd. in the prior year, on a 36-month lease...
-
A program uses a char variable named department and two double variables named salary and raise. The department variable contains one of the following letters (entered in either uppercase or...
-
In this exercise, you will create a program that displays the number of daily calories needed to maintain your current weight. The number of calories is based on your gender, activity level, and...
-
ROCKAUTO.COM is a leading online auto parts store that prides itself for offering a huge selection of auto parts, everyday low prices, fast shipping, and an easy-to-use Web site. Some ROCKAUTO.COM...
-
Required: Prepare the supporting schedules for your portfolio for presentation to Mandla the supervisor and senior administrator. The schedules for the portfolio need to cover the following: Part A...
-
Write a program that will predict the size of a population of organisms. The program should ask for the starting number of organisms, their average daily population increase (as a percentage), and...
-
Management is keen to reduce inventory levels for materials as well and closing inventories are to be much lower. Expected levels are shown below: Material M1 Material M2 Material M3 2,200 kg 1,300...
-
How do you calculate incremental cost for the following: Complying with the Clean Air Act Amendments will be costly. There are three main options for complying with the Clean Air Act: analyze the...
-
How do I journalize this transaction? Mountain Swirl Ice Cream purchased and took delivery of one ice cream machine for $7,500. Record the sale and the cost of the sale. Markup is 150% of cost....
-
In 2020, Susan (44 years old) is a highly successful architect and is covered by an employee-sponsored plan. Her husband, Dan (47 years old), however, is a Ph.D. student and is unemployed. Compute...
-
APC16550D UART has a clock running at18.432 MHz and its baud rate is set to 2000.Determine the HEX contents of its DLM and DLL registers. Please can you explain step by step and in detail how you get...
-
Write an application that stores at least five different college courses (such as CIS101), the time it first meets in the week (such as Mon 9 am), and the instructor (such as Johnson) in a...
-
In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fix. For example, DebugEight1.java will become...
-
Using a bubble sort involves comparing each array element with ____________. a. The corresponding element in a parallel array b. The adjacent element c. The arithmetic average d. The lowest element...
-
Problem 12.6A (Algo) Liquidation of a partnership LO P5 Kendra, Cogley, and Mel share income and loss in a 3.21 ratio (in ratio form: Kendra, 3/6: Cogley, 2/6; and Mel, 1/6), The partners have...
-
Melody Property Limited owns a right to use land together with a building from 2000 to 2046, and the carrying amount of the property was $5 million with a revaluation surplus of $2 million at the end...
-
Famas Llamas has a weighted average cost of capital of 9.1 percent. The companys cost of equity is 12.6 percent, and its cost of debt is 7.2 percent. The tax rate is 25 percent. What is the companys...
Study smarter with the SolutionInn App