Car passing at bridge tollbooth should pay 500. Mostly they do but sometimes a car goes by without paying. Model this tollbooth with class called toolbooth, the two data items are of tye integer total number of cars,and a type of of double total amount collected. A constructor initialize both of the items ti zero,a member function called payingcar() increases the car total and add 500 to the cash total. Another function called nonpayingcar() increment the total but ass nothing to the total cash, finally a member function called display() to display the two total. Include a program to test this class.
josberty
0
Newbie Poster
Recommended Answers
Jump to PostThe most striking problem I find with your question is that it tells you how to answer it. It even gives you instructions...
There's is nothing here that is difficult. Even for a beginner, it's simple maths (addition) and method calls (three of them). I'm guessing you haven't bothered to …
Jump to PostWhich bit are you struggling with exactly?
All 6 Replies
Ketsuekiame
860
Master Poster
Featured Poster
josberty
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
josberty
0
Newbie Poster
Ketsuekiame
860
Master Poster
Featured Poster
josberty
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.