subject

5.28 LAB: Toll calculation (EO) Toll roads have different fees based on the time of day and on weekends. Write a method calcToll() that has three parameters: the current hour of time (int), whether the time is morning (boolean), and whether the day is a weekend (boolean). The method returns the correct toll fee (double), based on the chart below. Weekday Tolls Before 7:00 am ($1.15) 7:00 am to 9:59 am ($2.95) 10:00 am to 2:59 pm ($1.90) 3:00 pm to 7:59 pm ($3.95) Starting 8:00 pm ($1.40) Weekend Tolls Before 7:00 am ($1.05) 7:00 am to 7:59 pm ($2.15) Starting 8:00 pm ($1.10) Ex: The method calls below, with the given arguments, will return the following toll fees: calcToll(7, true, false) returns 2.95 calcToll(1, false, false) returns 1.90 calcToll(3, false, true) returns 2.15 calcToll(5, true, true) returns 1.05

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
Which steps will open the system so that you can enter a question and do a search for
Answers: 1
You know the right answer?
5.28 LAB: Toll calculation (EO) Toll roads have different fees based on the time of day and on weeke...
Questions
question
Mathematics, 27.08.2021 01:20
question
Mathematics, 27.08.2021 01:20
question
Mathematics, 27.08.2021 01:20
question
History, 27.08.2021 01:20
Questions on the website: 13722362