Question: Add code to the starter code below that decides what value to store in the boolean variable getUp. It must be assigned a valid value,

 Add code to the starter code below that decides what value

Add code to the starter code below that decides what value to store in the boolean variable getUp. It must be assigned a valid value, but only assign it to true if the value of hoursofsleep is 6 or higher. Save Grading 3 Run Tests Full Screen Test 1 Not run NOT RUN Test 2 Not run NOT RUN GetUp.java + New 1 - import java.util.Scanner; 2 3. public class GetUp { 4 public static void main(String[] args) { 5 6 /Do not change the code in this section Scanner scanner = net Scanner(System.in); 8 int hoursOfSleep scanner.nextInt(); 9 boolean getUp; 10 11 V/ADD CODE HERE... 12 1/Add code to assign getUp the correct value below this line 13 14 15 /Do not change the code below 16 System.out.println("Time to get up: getUp); 17 18 scanner.close(); 19 } 20 } Test 3 NOT RUN Not run

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 Databases Questions!