// Justin C. Miller
// Date: 1-24-2001
// University of Wisconsin Oshkosh
// Made for: http://www.geocities.com/neonprimetime.geo/index.html
// Borland Builder 4.0
// Title: Toll Road Fees
// Description: Calculate a toll for road based on number of
// axles on the vehicle....50 cents plus 20 cents per axle
#include
#include
#include
void menu() ;
double CalculateCost(int) ;
int main()
{
bool finished = false ; // intiallly we're not finished
int axles = 0 ; // number of axles on the car
while( !finished )
{
system("cls") ;
menu() ;
cin >> axles ;
if(axles == 0) finished = true ;
else
{
cout << "The Cost for the car with " << axles << " axles is..." << endl ;
cout << "$" << CalculateCost(axles) << endl ;
system("pause") ;
}
}
return 0 ;
}
void menu()
{
cout << "Toll Road Calculator" << endl ;
cout << "Cost is 50 cents per vehicle...." << endl ;
cout << "Plus an additional 20 cents per axles." << endl ;
cout << "-------" << " (enter ZERO axles to quit)" << endl ;
cout << "PLEASE ENTER NUMBER OF AXLES ON VEHICLE:" ;
}
double CalculateCost(int a)
{
return (.50 + ( ( double ) a * .20) ) ;
}
               (
geocities.com/neonprimetime.geo/cpp)                   (
geocities.com/neonprimetime.geo)