Preview

PT1420 Unit 8 Lab 8

Satisfactory Essays
Open Document
Open Document
365 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
PT1420 Unit 8 Lab 8
Step 2: Explain what you think will be displayed to the screen in Step 1. (Reference: For loop, page 186): List hours starting with Hour 1 up to Hour 24, as declared “Max Hours”

Step 3: Write a for loop that will print 60 minutes to the screen. Complete the missing lines of code. Constant Integer MAX_MINUTES =60 Declare Integer minutes For Minutes = 1 to Max_Minutes Display “The minute is ”, minutes End For
Step 4: Write a for loop that will print 60 seconds to the screen. Complete the missing lines of code. Constant Integer MAX_SECONDS = 60 Declare Integer seconds For Seconds = 1 to Max_Seconds Display “The Second is ”, seconds End For
Step 6: Explain what you think will be displayed to the screen in Step 5. (Reference:
Incrementing by Values Other than 1, page 190): Display numbers starting at 0 through 10 by increments of 2. 0,2,4,6,8,10

Step 7: Write a for loop that will display the numbers starting at 20, then 40, then 60, and continuing the sequence all the way to 200. Constant Integer MAX_VALUE = 200 Declare Integer counter For counter = 20 to MAX_VALUE Step 20 Display “The number is “, Counter End For
Step 9: Explain what you think will be displayed to the screen in Step 8. (Reference:
Letting the User Control the Number of Iterations, page 194): Asks for Max number of students, then lists number of students by 1 till reached declared number of students.
Step 11: Explain what you think will be displayed to the screen in Step 10. (Reference:
Calculating a Running Total, page 201): Asks for input of a number 5 times then adds all numbers into one total sum, example 2,4,6,8,10 = 30
Step 12: Write the missing lines for a program that will allow the user to enter how many ages they want to enter and then find the average. Declare Integer counter
Declare Integer totalAge = 0 Declare Real averageAge = 0 Declare Integer age Declare Integer number Display “How many ages do you want to

You May Also Find These Documents Helpful