Imagine a tollbooth with a class called TollBooth. The two data items are of type int...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Imagine a tollbooth with a class called TollBooth. The two data items are of type int and double to hold the total number of cars and total amount of money collected. A constructor initializes both of these data members to O. A member function called payingCar() increments the car total and adds 0.5 to the cash total. Another function called nonPayCar() increments the car total but adds nothing to the cash total. Finally a member function called display() shows the two totals. Include a program to test this class. This program should allow the user to push one key to count a paying car, and another to count a non paying car. Pushing the 'E' key should cause the program to print out the total number of cars and total cash and then exit Imagine a tollbooth with a class called TollBooth. The two data items are of type int and double to hold the total number of cars and total amount of money collected. A constructor initializes both of these data members to O. A member function called payingCar() increments the car total and adds 0.5 to the cash total. Another function called nonPayCar() increments the car total but adds nothing to the cash total. Finally a member function called display() shows the two totals. Include a program to test this class. This program should allow the user to push one key to count a paying car, and another to count a non paying car. Pushing the 'E' key should cause the program to print out the total number of cars and total cash and then exit
Expert Answer:
Related Book For
An Introduction to Management Science Quantitative Approach to Decision Making
ISBN: 978-1337406529
15th edition
Authors: David R. Anderson, Dennis J. Sweeney, Thomas A. Williams, Jeffrey D. Camm, James J. Cochran
Posted Date:
Students also viewed these computer engineering questions
-
Cars arrive at a tollbooth at a mean rate of 5 cars every 10 minutes according to a Poisson process. Find the probability that the toll collector will have to wait longer than 26.30 minutes before...
-
One consolidated group member lends money to another member of its group. Both corporations use the accrual method of accounting. Explain how the lending group member reports its interest income and...
-
A sophomore with nothing better to do adds heat to 0350 kg of ice at 0.0oC until it is all melted. (a) What is the change in entropy of the water? (b) The source of heat is a very massive body at a...
-
Over the last few years, we have started to see some retailers open earlier and earlier on Thanksgiving Day. Others have taken a different approach and decide to remain closed. Is it a good strategy...
-
Using the formulas for series parallel circuits, fill in the blanks in the tables shown opposite each circuit. In the blanks across from Battery under V: Write the emf of the battery. I: Write the...
-
In Problems 9 18, (a) Find the dot product v w; (b) Find the angle between v and w ; (c) State whether the vectors are parallel, orthogonal, or neither. v = i + 3j, w = i j
-
White Mountain Corporation (WMC) sells computer components. It is a publicly traded corporation. William serves as WMCs Chief Executive Officer (CEO). William owns 15 percent of WMCs outstanding...
-
Manufacturing overhead data for the production of Product H by Norland Company are as follows. Overhead incurred for 52,000 actual direct labor hours worked ...$213,000 Overhead rate (variable $3;...
-
1. An unpolarized light beam is incident on the polarizes of a polarization experiment and the intensity of light beam emerging from the analyzer is measured as 100 Lumens. Now, if the analyzer is...
-
Read the case study "Southwest Airlines," found in Part 2 of your textbook. Review the "Guide to Case Analysis" found on pp. CA1 - CA11 of your textbook. (This guide follows the last case in the...
-
You want to start a tin food manufacturing company. Explain in practical terms where in the country you will set up the factory. Quote theory and give practical examples.
-
Pamela's salary in 2017-18 is 105,000. She has no other income for the year and she is not a Scottish taxpayer. (a) Calculate her income tax liability for 2017-18. (b) Re-calculate her income tax...
-
Rose is single and has total income of 11,250 in 2017-18. She makes a gross deductible payment of 25 during th e year. Show her income tax computation for the year and determine the amount of tax...
-
Simon owns an apartment which he lets to tenants. The apartment was let throughout tax year 2017-18 at a weekly rental of 320. The expenses incurred by Simon in relation to this apartment during...
-
Toby is a widower. He was born in August 1932. His wife was born in June 1933 but she died in March 2017. Toby's income for 2017-18 is as follows: 10,480 912 Retirement pension Income from purchased...
-
Matthew (who was born on 1 May 1934) dies on 23 December 2017. His only income in tax year 2017 -18 is a retirement pension of 2 9,260. H e made a Gift Aid donation of 200 in July 2017. His wife has...
-
Complete the following table: Note: Round your answers to 2 decimal places. Product A Unit Contribution Margin $ Product B Unit Contribution Margin 10.00 S 2.00 16.10 46.70 7.00 4.60 13.00 56.10...
-
Which of the following streaming TV devices does not involve use of a remote controller? A) Google Chromecast B) Apple TV C) Amazon Fire TV D) Roku
-
The Statewide Auto Insurance Company developed the following probability distribution for automobile collision claims paid during the past year: Payment($)_____________________Probability...
-
An Internet-service provider company uses a fiber-optic network to transmit data between locations. Data are carried through fiber-optic cables and switching nodes. A portion of the companys...
-
Options are popular instruments in the world of finance. A call option on a stock gives the owner the right to buy the stock at a predetermined price before the expiration date of the option. For...
-
Online electronics retailer Kogan has announced an initial public offering to raise $50 million, with plans to list on the ASX at the end of June. Kogan, founded in 2006, said it would have a market...
-
For each company below, fill in the missing data. Each company is independent. Sales Beginning finished goods Cost of goods manufactured Ending finished goods Cost of sales Income Statement Company X...
-
Innovative Computers Pty Ltd began manufacturing inexpensive computers for the student market on 1 July 2018. The variable costs of manufacturing each computer are as follows. During the year ended...
Study smarter with the SolutionInn App