Question Number 15311 by arnabpapu550@gmail.com last updated on 09/Jun/17

$$\mathrm{In}\:\mathrm{a}\:\mathrm{toll}-\mathrm{booth}\:\mathrm{at}\:\mathrm{a}\:\mathrm{bridge}\:,\:\mathrm{some}\:\mathrm{cars}\:\mathrm{can}\:\mathrm{pass}\:\mathrm{by}\:\mathrm{paying}\:\mathrm{a}\:\mathrm{tax}\:\mathrm{of}\:\mathrm{Rs}.\:\mathrm{10}\:\mathrm{and} \\ $$$$\mathrm{some}\:\mathrm{special}\:\mathrm{vehicles}\:\mathrm{are}\:\mathrm{exempted}\:\mathrm{from}\:\mathrm{paying}\:\mathrm{tax}.\:\mathrm{The}\:\mathrm{booth}\:\mathrm{has}\:\mathrm{to}\:\mathrm{track}\: \\ $$$$\mathrm{number}\:\mathrm{of}\:\mathrm{vehicles}\:\mathrm{and}\:\mathrm{total}\:\mathrm{tax}\:\mathrm{collected}.\:\mathrm{Define}\:\mathrm{a}\:\mathrm{class}\:'\mathrm{tollbooth}'.\:\mathrm{It}\:\mathrm{should}\:\mathrm{contain} \\ $$$$\mathrm{two}\:\mathrm{data}\:\mathrm{items}\:\mathrm{of}\:\mathrm{type}\:\mathrm{int}\:\mathrm{to}\:\mathrm{hold}\:\mathrm{the}\:\mathrm{number}\:\mathrm{of}\:\mathrm{cars}\:\mathrm{and}\:\mathrm{total}\:\mathrm{tax}\:\mathrm{connected}. \\ $$$$\mathrm{A}\:\mathrm{constructor}\:\mathrm{initalizes}\:\mathrm{these}\:\mathrm{two}\:\mathrm{variable}\:\mathrm{to}\:\mathrm{zero}.\:\mathrm{A}\:\mathrm{memberfunction}\:\mathrm{freecar}\left(\right)\:\mathrm{only} \\ $$$$\mathrm{increments}\:\mathrm{the}\:\mathrm{car}\:\mathrm{total}.\:\mathrm{Finally}\:\mathrm{another}\:\mathrm{memberfunction}\:\mathrm{show}\left(\right)\:\mathrm{displays}\:\mathrm{the} \\ $$$$\mathrm{two}\:\mathrm{totals}. \\ $$$$\:\:\:\mathrm{Write}\:\mathrm{a}\:\mathrm{C}++\:\mathrm{program}\:\mathrm{such}\:\mathrm{that}\:\mathrm{the}\:\mathrm{user}\:\mathrm{has}\:\mathrm{to}\:\mathrm{press}\:\mathrm{the}\:\mathrm{key}\:'\mathrm{T}'\:\mathrm{for} \\ $$$$\mathrm{printing}\:\mathrm{number}\:\mathrm{of}\:\mathrm{taxable}\:\mathrm{cars}\:\mathrm{and}\:\mathrm{total}\:\mathrm{tax},\:'\mathrm{F}'\:\mathrm{for}\:\mathrm{printing}\:\mathrm{number}\:\mathrm{of}\:\:\mathrm{free} \\ $$$$\mathrm{cars}\:\mathrm{and}\:'\mathrm{Esc}'\:\mathrm{to}\:\mathrm{exit}. \\ $$