// calculates toll to be paid depending on the vehicle class // mikhail nesterenko // 09/14/99 #include using std::cout; using std::cin; using std::endl; int main() { // inputs the vehicle class int vclass; cout << "Enter the vehicle class: "; cin >> vclass; int toll; // toll to be paid switch (vclass){ case 1: cout << "Passenger car "; toll = 1; break; case 2: cout << "Bus "; toll = 3; break; case 3: cout << "Truck "; toll = 5; break; default: cout << "Unknown vehicle class! "; toll = 0; break; } // output toll calculated cout << "please pay $" << toll << endl; }