Need help with C++ program. Make the program provide the same output as the expected output below.
Fantastic news! We've Found the answer you've been seeking!
Question:
Need help with C++ program. Make the program provide the same output as the expected output below.
Transcribed Image Text:
void readInt(string prompt, int &num) (****new for this level****) 1. This function should be used any time you read any integers from the user. Use this function to read the menu option from the user. 2. It takes a string prompt, outputs it, reads a number from the user, validates and returns the num by reference. 3. See Samplea01.cpp for the function. You may use the function in the sample. 4. You must catch all invalid data such as characters, negative numbers etc. void readDouble (string prompt, double &num) (****new for this level****) This function should be used any time you read any floats or doubles from the user. Use this function to read the cost of the item, tip, etc from the user. 1. 2. It takes a string prompt, outputs it, reads a number from the user, validates and returns the num by reference. 3. Write it exactly like the readint but declare a double or float instead of an int. 4. You must catch all invalid data such as characters, negative numbers etc. void placeOrder (double &cost) 1. Call this function if the user selects 1 from the menu. 2. This function will go through a loop and ask the user to enter item names and their cost until the user answers 'n' to the question - Do you want another item? (y/n): You must validate to make sure the user enters y/n for this question (it should not be case sensitive - must accept both uppercase and lowercase). Use a while loop to do this. 3. The total cost must be returned through the reference parameter and be printed in main(). 4. Call the readDouble function to do this. You must catch all invalid data such as characters, negative numbers etc. 5. Do not print anything in this function. The tip, discount, and final total must be printed in main (). void readInt(string prompt, int &num) (****new for this level****) 1. This function should be used any time you read any integers from the user. Use this function to read the menu option from the user. 2. It takes a string prompt, outputs it, reads a number from the user, validates and returns the num by reference. 3. See Samplea01.cpp for the function. You may use the function in the sample. 4. You must catch all invalid data such as characters, negative numbers etc. void readDouble (string prompt, double &num) (****new for this level****) This function should be used any time you read any floats or doubles from the user. Use this function to read the cost of the item, tip, etc from the user. 1. 2. It takes a string prompt, outputs it, reads a number from the user, validates and returns the num by reference. 3. Write it exactly like the readint but declare a double or float instead of an int. 4. You must catch all invalid data such as characters, negative numbers etc. void placeOrder (double &cost) 1. Call this function if the user selects 1 from the menu. 2. This function will go through a loop and ask the user to enter item names and their cost until the user answers 'n' to the question - Do you want another item? (y/n): You must validate to make sure the user enters y/n for this question (it should not be case sensitive - must accept both uppercase and lowercase). Use a while loop to do this. 3. The total cost must be returned through the reference parameter and be printed in main(). 4. Call the readDouble function to do this. You must catch all invalid data such as characters, negative numbers etc. 5. Do not print anything in this function. The tip, discount, and final total must be printed in main ().
Expert Answer:
Related Book For
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr
Posted Date:
Students also viewed these algorithms questions
-
re Regular Languages and Finite Automata (a) Let L be the set of all strings over the alphabet {a, b} that end in a and do not contain the substring bb. Describe a deterministic finite automaton...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
1. Estimate the model Debt = 30 + 1lnc + 32Unemp + . Is unemployment significant at the 5% level? 2. You are told that the unemployment rate might have a quadratic influence on monthly debt payments....
-
What class of motion, natural or violent, did Aristotle attribute to motion of the Moon?
-
Intense research is underway to develop adiabatic engines that require no cooling of the engine block. Such engines are based on ceramic materials because of the ability of such materials to...
-
As a check on the quality of eye glasses purchased over the internet, glasses were individually ordered from several different online vendors. Among the 92 lenses with antireflection coating, 61...
-
Due to rapid turnover in the accounting department, a number of transactions involving intangible assets were improperly recorded by Wasp Company in 2010. 1. Wasp developed a new manufacturing...
-
Now we have a rod-shaped space station of length 1336 m and mass 6.24 x 10^6 kg, which can change its length (kind of like an old-fashioned telescope), without changing its overall mass. Suppose that...
-
Towson Company prepared the tabulation below at December 31, 2017 Net Income $201,000 Adjustments to reconcile net income to net cash provided by operating activities: Depreciation expense 75,000...
-
ABC Corp. reported the following balances on December 31 (1) inventory: 2015 --- P 2,600,000, 2014 --- 2,900,000; (2) accounts payable: 2015 ---750,000, 2014 --- 500,000. ABC paid its suppliers P...
-
Whirly Corporation s contribution format income statement for the most recent month is shown below: Total Per Unit Sales ( 7 , 9 0 0 units ) $ 2 6 0 , 7 0 0 $ 3 3 . 0 0 Variable expenses 1 4 2 , 2 0...
-
The Digby's balance sheet has $ 130, 7 5 0 , 0 0 0 in equity. Further, the company is expecting $ 3 , 500, 0 0 0 in net income next year. Assuming no dividends are paid and no stock is issued, what...
-
On January 16, Tree Co. paid $60,000 in property taxes on its factory for the current calendar year. On April 2, Tree paid $240,000 for unanticipated major repairs to its factory equipment. The...
-
You have just been hired by FAB Corporation, the manufacturer of a revolutionary new garage door opening device. The president asked you to review the company s costing system and do what you can to...
-
Find f, and fy 3x2 4y? f(x, y) 2 + 3 2 +
-
Perform the indicated operations. In designing a cam for a fire engine pump, the expression is used. Simplify this expression. (3) (3 4 32
-
Go to the library and search out print media (i.e., magazine and newspaper) advertising by a company, or one of its products or brands in different countries. Does this company use standardized or...
-
Licensing seems to be a fairly safe way for a manufacturer to produce in a foreign market for the first time. Comment.
-
What are the differences and similarities between origin image and the origin biases?
-
Briefly explain the difference between accounting, finance, and engineering economics. Try to put the concepts in your own (or your team's) words and compare the concepts where appropriate.
-
What are the two key financial objectives in the management of a company? How can a focus on these objectives create ethical dilemmas?
-
Among your colleagues in class, identify a term or phrase italicized in this chapter that you think is the most significant from your reading. Absent team consensus, then just provide your...
Study smarter with the SolutionInn App