Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Jeroo named pat is at the jeroo olympics to cheer on two friends competing in the high jump. These jeroos can jump super high.

image text in transcribedimage text in transcribed

A Jeroo named pat is at the jeroo olympics to cheer on two friends competing in the high jump. These jeroos can jump super high. Implement the method react( ) below so that it takes pat and the heights (in meters) of the two jumps as parameters. If either height is at least 4 meters, pat should plant a flower in honor of the jump, unless either height is lower than 2 meters, in which case pat should instead turn left (toward the exit). In the case where pat turns to leave, he should not plant any flowers. Otherwise, pat should do nothing while waiting for the results of other competitors. Your Answer: A Jeroo named pat only wakes up and hops when it is time. Implement the following method called wakeUp ( ) that takes pat, two integers, and a boolean value as parameters. If it is at or past pat 's wake-up time, pat will hop ( ) out of bed; otherwise, pat will remain still. The first integer provided represents the day of the week encoded as 0= Sun, 1= Mon, 2= Tue, ..6= Sat. The second integer represents the hour (0-23), and the boolean indicates if pat is on vacation. On weekdays, if the time is 7 (am) or later, pat should hop (out of bed). On weekends, pat sleeps in, and will hop out of bed at 10 or later. Unless pat is on vacation, in which case hopping out of bed begins at 10 on weekdays, and 12 on weekends. Your Answer: A Jeroo named pat is at the jeroo olympics to cheer on two friends competing in the high jump. These jeroos can jump super high. Implement the method react( ) below so that it takes pat and the heights (in meters) of the two jumps as parameters. If either height is at least 4 meters, pat should plant a flower in honor of the jump, unless either height is lower than 2 meters, in which case pat should instead turn left (toward the exit). In the case where pat turns to leave, he should not plant any flowers. Otherwise, pat should do nothing while waiting for the results of other competitors. Your Answer: A Jeroo named pat only wakes up and hops when it is time. Implement the following method called wakeUp ( ) that takes pat, two integers, and a boolean value as parameters. If it is at or past pat 's wake-up time, pat will hop ( ) out of bed; otherwise, pat will remain still. The first integer provided represents the day of the week encoded as 0= Sun, 1= Mon, 2= Tue, ..6= Sat. The second integer represents the hour (0-23), and the boolean indicates if pat is on vacation. On weekdays, if the time is 7 (am) or later, pat should hop (out of bed). On weekends, pat sleeps in, and will hop out of bed at 10 or later. Unless pat is on vacation, in which case hopping out of bed begins at 10 on weekdays, and 12 on weekends. Your

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions