0% found this document useful (0 votes)
38 views2 pages

Worksheet 4

Uploaded by

Abel Media
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Worksheet 4

Uploaded by

Abel Media
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

------------------------------------------------------------------------------ (e)

***** Lab Challenges #4 [ Iterations, Loops ] ***** 1


------------------------------------------------------------------------------ 12
123
1. Create a counting program that counts from 1 to 100 in 1234
increments of 5. 12345
123456
2. Create a counting program that counts backward from 200 to 1 1234567
in increments of 10. 12345678
123456789
3. Write a program that prints a patterns as demonstrated next 1234567890
(Using your prefered iteration method). 123456789
12345678
(a) * (b) * * * * * * * * 1234567
** ******* 123456
*** ****** 12345
**** ***** 1234
***** **** 123
****** *** 12
******* ** 1
******** *
(c) (d) 0 4. Store the user’s answers in variables. Use the acquired data to
* 90 build your counting program with a for loop and display the
*** 890 results to the user.
***** 7890 • Beginning number to start counting from
******* 67890 • Ending number to stop counting at
********* 567890 • Increment number
*********** 4567890
************* 34567890 5. Create a math quiz program that prompts the user for how many questions to
*********** 234567890 ask. The program should congratulate the player if he or she gets the correct
********* 1234567890 answer or alert the user of the correct answer in the event the question is answered
******* incorrectly. The math quiz program should also keep track of how many questions
***** the player has answered correctly and incorrectly and display these running totals
*** at the end of the quiz.
*
6. Create a Concentration Game to using a main menu. The menu should allow the
user to select a level of difficulty and/or quit the game (a sample menu is shown
below). The level of difficulty could be determined by how many separate
numbers the user has to concentrate on and/or how many seconds the player has to
concentrate. Each time the user completes a single game of Concentration, the
menu should reappear allowing the user to continue at the same level, at a new
level, or simply quit the game.

• Easy (remember 3 numbers in 5 seconds)


• Intermediate (remember 5 numbers in 5 seconds)
• Difficult (remember 5 numbers in 2 seconds)
• Quit

You might also like