Question: Write a method that calculates and returns the toll on the 5 2 0 bridge on weekends and holidays. The method takes three parameters: hour,

Write a method that calculates and returns the toll on the 520 bridge on weekends and holidays. The method takes three parameters: hour, minute and am/pm and returns the toll price. Use the following toll table in your calculations. If the hour value is not in range [0,12] or the minute value is not in range [0,59] or am/pm are incorrectly spelled the method must return -1 as an error code.
Start coding with TwoMethodsA02.zip Download TwoMethodsA02.zip.
Weekends and Holidays**
Good To Go! Pass Toll
Midnight to 4:59 am
$1.75
5 am to 6:59 am
$2.40
7 am to 9:59 am
$3.95
10 am to 3:59 pm
$2.65
4 pm to 7:59 pm
$3.95
8 pm to 10:59 pm
$2.40
11 pm to 11:59 pm
$1.75

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!