C++ Workshop‎ > ‎

Part 4 of C++ Workshop

PROGRAM. Art I

Objective. To learn about looping
What to do. Write a program that produces the following output:
********************
********************


PROGRAM. Art 2

Objective. To learn about looping and using the for loop’s index variable
What to do. Write a program that produces the following output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


PROGRAM. The Guess My Number Game. Game One.

Objective. To learn about logic and looping
What to do. Write a program that plays a game with the user. The user has to guess the number that the computer is “thinking” about.

Hello user! I'm thinking of a number between 1 and 100. See if you can guess it!
50
Higher!
80
Lower!
65
Higher!
66
You guessed it in 4 guesses, congratulations!



PROGRAM. The Guess My Number Game. Game Two.

Objective. To learn about logic and looping
What to do. Write a program that plays a game with the user. The computer has to guess the number that the user is thinking about.

Hello user!  Think of a number between 1 and 100. See if I can guess it! 
Is it 50? (higher or lower? Type H or L)
H
Is it 80? (higher or lower? Type H or L)
L
...
etc.


PROGRAM. Art 2

Objective. To learn about nested loops
What to do. Write a program that produces the following output:

*
**
***
****
*****
******
*******
********
*********
**********


PROGRAM. Mad Libs Part Deux. (Time permitting)

Objective. To learn about functions
What to do. Redo your Mad LIbs program from earlier so that you use a function to output your story.

Comments