Answered step by step
Verified Expert Solution
Question
1 Approved Answer
11 THE VACATION PROBLEM Write a method named vacation, which takes two arguments: a day of the week encoded as 0-Sun, 1-Mon, 2-Tue,..6-Sat, and a
11 THE VACATION PROBLEM Write a method named vacation, which takes two arguments: a day of the week encoded as 0-Sun, 1-Mon, 2-Tue,..6-Sat, and a boolean indicating if you are on vacation. Return a String of the form "7:00" indicating when your alarm clock should ring. On weekdays, the alarm should be "7:00" and on the weekend it should be "10:00". Unless you are on vacation; then on weekdays it should be "10:00" and weekends it should be "off". Don't put quotes around your answer. .input of 1, false"7:0e .input of 5, false"7:e input of 0, false "18:00 12 THe SPECIAL SUM PROBLEM Write a method named specialSum. Return the sum of the two int arguments, a and b. However, sums in the range 10..19 inclusive, are forbidden, so in that case just return 20. .input of 3, 4+7 . input of 9, 4 20 . input of 10, 11 - 21 13 THE TICKET PROBLEM You are driving a little too fast, and a police officer stops you. Write a method named ticket that determines what happens: you may get no ticket (0), a small ticket (25) or a big ticket (275). If your speed is 60 or less, there is no ticket. If your speed is between 61 and 80 inclusive, the result is a small ticket. If your speed is 81 or more, the result is a large ticket. Unless it is your birthday; on that day, your speed can be 5 higher in all cases. . input of 60, birthday-false e input of 65, birthday-false 25 . input of 65, birthday-true 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started