Home / Expert Answers / Computer Science / write-a-program-that-is-given-two-integers-representing-a-speed-limit-and-driving-speed-in-miles-p-pa675

(Solved): Write a program that is given two integers representing a speed limit and driving speed in miles p ...



Write a program that is given two integers representing a speed limit and driving speed in miles per hour (mph) and outputs t

Write a program that is given two integers representing a speed limit and driving speed in miles per hour (mph) and outputs the traffic ticket amount. Driving \( 10 \mathrm{mph} \) under the speed limit (or slower) receives a \$50 ticket. Driving \( 6-20 \mathrm{mph} \) over the speed limit receives a \$75 ticket. Driving 21 - \( 40 \mathrm{mph} \) over the speed limit receives a \$150 ticket. Driving faster than \( 40 \mathrm{mph} \) over the speed limit receives a \( \$ 300 \) ticket. Otherwise, no ticket is received. Ex: If the input is: \[ 3545 \] the output is: \[ 75 \] Ex: If the input is: \[ 3526 \] the output is: Note: Do not use \&\& to specify the ranges. Use what the book calls "Detecting ranges implicitly" in Participation Activity \( 3.5 .10 \) (the example on the right-hand side). There will be a 6 point deduction for using \&\& to detect the ranges explicitly.


We have an Answer from Expert

View Expert Answer

Expert Answer


#include using namespace std; int main() { int speedLimit, drivingSpeed; cout<<"Enter Speed Limit: "; cin>>speedLimit; cout<<
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe