// more code here } } 4. Compile and run the program to see the output. 5. Locate comment 2, and follow the instructions. The value 6745 is an integer, so the data type should be int. Enter the following code below the comment. Remember to insert a space after walk and before steps. Then, compile and run the program. /***** 2. Define a variable named targetSteps that has the value 6745 and output its value. */ int targetSteps = 6745 System.out.println( "Today, I want to walk " + targetSteps + " steps." ) 6. Locate comment 3, and follow the instructions. The value .5 is a real number, so the data type should be double. Enter the following code below the comment. Then, compile and run the program. /***** 3. Define a variable named oneHalf that has the value .5 and output its value. */ double oneHalf = .5 System.out.println( "One-half as a decimal is " + oneHalf + "." ) 7. Locate comment 4, and follow the instructions. The asterisk (*) is a character, so the data type should be char. Enter the following code below the comment. Then, compile and run the program. /***** 4. Define a variable named star that has the value * and output its value. */ char star = '*' // note the apostrophes around the asterisk System.out.println( "I earned a " + star + " for my work today." ) 8. Locate comment 5, and follow the instructions. The number of inches in a foot is an integer and does not change. So the data type should be an int set as a constant. For a constant, insert the keyword final before the data type. Enter the following code below the comment. Then, compile and run the program. /***** 5. Define a constant for the number of inches in a foot and output its value. */ final int INCHES_IN_FOOT = 12 System.out.println( "There are " + INCHES_IN_FOOT + " inches in one foot." ) 9. Check the final output. Does it match this text? The calories in a double hamburger are 563. Today, I want to walk 6745 steps. One-half as a decimal is 0.5. I earned a * for my work today. There are 12 inches in one foot. Try It! In the VariableSnippet file, add code to define each of the following variables using a meaningful name and appro- priate data type. Output a sentence with the value of each variable. Compile and run the program to check your work. • number of puzzle pieces in a jumbo puzzle assign the value 1000 • price of your favorite fruit snack assign the value .89 and include a dollar sign in the output Copyright Goodheart-Willcox Co., Inc. 86 Introduction to Computer Science: Java Programming