Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Pennsylvania Turnpike charges tolls based on vehicle class. Classes are defined as: - Class 1: less than 7000 lbs; - Class 2: 7001 -
The Pennsylvania Turnpike charges tolls based on vehicle class. Classes are defined as:
- Class 1: less than 7000 lbs;
- Class 2: 7001 - 15,000 lbs;
- Class 3: 15,001 - 19,000 lbs;
- Class 4: 19,001 - 30,000 lbs;
- Class 5: more than 30,000 lbs.
Write a .cpp program that asks the user for a vehicles weight and figure out the vehicles class. Then use a switch statement to calculate the toll: $4 for class 1, $6 for class 2, $10 for class 3, $20 for class 4, $40 for class 5.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started