Parking Fee
hardQuestion 253Two variables describe a parking stay: hours (may be fractional) and isWeekend (a boolean). The fee is 3 for the first hour and 2 for each additional hour or part of an hour, so use Math.ceil to round the hours up to a whole number first. The fee is capped at 20. On a weekend the final fee is halved. A stay of 0 hours costs nothing. Compute the fee into a variable called fee with if statements and print Fee: <fee>.
Expected output
Fee: 13= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.