Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

OUTCOME 1 Explain the reasons for equity-related legislation.

Answered: 1 week ago