Question: Create code that sets the variable rate to the cost of a 1 4 mile cab ride. If the distance traveled is less than or

Create code that sets the variable rate to the cost of a 14 mile cab ride. If the distance traveled is less than or equal to 12 miles, then rate cost is $2.00 a mile, and if the distance traveled is more than 12 miles then rate cost is $1.50 a mile. Assign the final cost to the variable total.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!