Imagine a tollbooth at a bridge. Cars passing by the booth are expected to pay 30...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Imagine a tollbooth at a bridge. Cars passing by the booth are expected to pay 30 Rupees toll. Mostly they do, but sometimes a car goes by without paying. The tollbooth keeps track of the number of cars that have gone by, and of the total amount of money collected. Model this tollbooth in this question, which keep track of total number of cars passed, and total toll collected. Every line of input contains N or P. When P is input, a paying car crosses the tollbooth. When N is input, a Non paying car crosses the tollbooth. The last input is Q, where the program stops. Finally it prints the total number of cars passed, and total toll collected. • Input Format For Custom Testing Sample Case 0 Sample Input For Custom Testing Sample Output Total cars passed : Total toll collected : 90 Explanation Four cars passed the tollbooth. 3 cars paid the toll, hence total toll collected is 90 a Pz Po Imagine a tollbooth at a bridge. Cars passing by the booth are expected to pay 30 Rupees toll. Mostly they do, but sometimes a car goes by without paying. The tollbooth keeps track of the number of cars that have gone by, and of the total amount of money collected. Model this tollbooth in this question, which keep track of total number of cars passed, and total toll collected. Every line of input contains N or P. When P is input, a paying car crosses the tollbooth. When N is input, a Non paying car crosses the tollbooth. The last input is Q, where the program stops. Finally it prints the total number of cars passed, and total toll collected. • Input Format For Custom Testing Sample Case 0 Sample Input For Custom Testing Sample Output Total cars passed : Total toll collected : 90 Explanation Four cars passed the tollbooth. 3 cars paid the toll, hence total toll collected is 90 a Pz Po
Expert Answer:
Answer rating: 100% (QA)
include using namespace std int getche class Tollbooth public Tollboothunsigned int 0 double 0 c... View the full answer
Related Book For
Fundamental Statistics for the Behavioral Sciences
ISBN: 978-1285076911
8th Edition
Authors: David C. Howell
Posted Date:
Students also viewed these programming questions
-
The Mars Candy Company actually keeps track of the number of red, blue, yellow, etc. M&MsTM there are in each batch. (These make wonderful examples for discussions of sampling.) a) This is an example...
-
A software development company keeps track of the number of errors found in the programs written by the company employees. DS 6.6.3 shows the number of errors found in the 30 programs that were...
-
At this time you are expected to pay the balance of the loan in the balloon payment shown above. Don't panic! Usually the loan is refinanced for another year. But beware-you may have to pay a higher...
-
The following e-mail message contains numerous errors related to what you've learned about planning and writing business messages. Using the information it contains, write a more effective version....
-
Calculate the power dissipated in each resistor in the circuit in Fig. 3.104? Figure 3.104 0.5i, 4 8 0 10 V 2 1(2
-
What are the implications for management of a closed shop, a union shop, and an agency shop?
-
Help for Insomniacs In Exercise 1.23, we learned of a study to determine whether just one session of cognitive behavioral therapy can help people with insomnia. In the study, forty people who had...
-
Whispering issued an 9%, 10-year $1,800,000 bond to build a monorail mass transit system. The city received $1,587,988 cash from the bond issuance on January 1, 2025. The bond yield is 11%. Interest...
-
Capstone Exercise One of the best ways to illustrate the value of good market research and the importance of applying the results of market research to your marketing strategy is to look at a...
-
Effective financial statement analysis requires an understanding of a firms economic characteristics. The relations among various financial statement items provide evidence of many of these economic...
-
Rhine Minerals Ltd has exploration licenses for the areas of interest of Forest and Twiggy. Exploration and evaluation costs of $7,500,000 were incurred at Site Forest and exploration and evaluation...
-
If ( X 1 , X 2 ) ( X 1 , X 2 ) and ( X 3 , X 4 ) ( X 3 , X 4 ) are independent bivariate random variables, are X 2 X 2 and X 3 X 3 independent random variables? Why or why not?
-
A currency trader observes that in the spot exchange market, 1 U.S. dollar can be exchanged for 3.4 Israeli shekels or for 106 Japanese yen. What is the cross-exchange rate between the yen and the...
-
Under what circumstances, if any, can an adopted child gain access to adoption records in your state? What kind of information can be obtained? Is it possible to find out whether the mother was...
-
As applied to linear, passive, bilateral two-port networks, the \(A B C D\) parameters satisfy \(A D-B C=1\). (a) True (b) False
-
Think about a journey you have made on public transport. What are the labour costs of operating one journey? What overhead costs are incurred by the organisation providing the transport? How might...
-
information for the current year: Sales Revenue Cost of Goods Sold 450,000 130,000 6,000 Long-term capital gain Operating expenses 100,000 Guaranteed payment to Rachel for services 45,000...
-
Explain how two samples can have the same mean but different standard deviations. Draw a bar graph that shows the two samples, their means an standard deviations as error bars. T S
-
Several times in this chapter I have drawn a parallel between hypothesis testing and our judicial system. How would you describe the workings of our judicial system in terms of Type I and Type II...
-
What reasons might explain the finding that the amount of money that a country spends on health care is not correlated with life expectancy?
-
I have argued that paw-lick latencies can reasonably be taken to be an interval scale of pain sensitivity in mice. Suppose that someone else felt that the square root of paw-lick latency was more...
-
Following up on question number 3, assume the school conducts a manifestation determination meeting. Tim attends the meeting with his parents. At the meeting, Tim tells the team that smoking helps...
-
Which is an advantage to an employee who participates in a profit-sharing plan? A. Employee does not have to make investment decisions. B. Graded vesting schedule. C. Older employees receive the...
-
Which of the following is not a characteristic of a defined benefit plan? A. A guaranteed retirement benefit. B. Risk of preretirement inflation assumed by employer. C. Benefits based upon the...
Study smarter with the SolutionInn App