Question: Using C++ code and NOT using loops. We can use if statements, if/else statements, nested if statements, and if/else if statements. So, eventhough all that
Using C++ code and NOT using loops. We can use if statements, if/else statements, nested if statements, and if/else if statements.
So, eventhough all that hard work was completed to determine what my monthly vehicle expenses would be if I purchased a Santa Fe, I actually decided to instead go with a Limited Sonata. Now that I have a new vehicle, I must register it. Based on an automobile's model year and weight the state of Alabama determines the car's weight class and registration fee using the following schedule:
| Model Year | Weight | Weight Class | Registration Fee |
| 2000 or earlier | Less than 3000lbs (compact cars) | 1 | $50 - $90 |
| 3100 to 4300 (midsize cars; compact Trucks & SUVS) | 2 | $91 - #125 | |
| More than 4300lbs (Large cars, trucks & SUVs) | 3 | $136 - $210 | |
| 2001 to 2015 | Less than 3000lbs (compact cars) | 4 | $80 - $120 |
| 3100 to 4300 (mid size cars; compact Trucks & SUVS) | 5 | $121 - $155 | |
| More than 4300lbs (Large cars, trucks & SUVs) | 6 | $156 - $230 | |
| 2016 or later | Less than 3000lbs (compact cars) | 7 | $100-$140 |
| 3100 to 4300 (midsize cars; compact Trucks & SUVS) | 8 | $141 - $175 | |
| More than 4300lbs (Large cars, trucks & SUVs) | $176 - $250 |
Using this information, write a C++ program that accepts the year and weight of an automobile and determines and displays the weight class and registration fee for the car. Be sure that the user enters valid information, if invalid entry the program should end.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
