Assignment 11
Due Wednesday, February 21 at 9:20am on Canvas

Assignment 11.1: Hickory-Dickory-Dock (10 pts)
  • Create a new C++ file called hickory.cpp.
  • Write a program that uses a while loop to print the numbers from 1 to 150, with each number printed on its own line.
  • For multiples of three print "Hickory!" instead of the number
  • For the multiples of five print "Dickory!" instead of the number.
  • For numbers which are multiples of both three and five print "Dock! The Mouse Ran Up the Clock!".
  • You must use a while loop for full credit.
  • Hint: Test for numbers that are multiples of both 3 and 5 first.
  • When you are finished, and your output looks like mine, upload your assignment to Canvas.
Your Output Should Look Like the Following. Note that some values have been omitted for brevity.

1
2
Hickory!
4
Dickory!
Hickory!
7
8
Hickory!
Dickory!
11
Hickory!
13
14
Dock! The Mouse Ran Up the Clock!
16
17
Hickory!
19
Dickory!
Hickory!
22
...
149
Dock! The Mouse Ran Up the Clock!


Assignment 11.2: Rock Paper Scissors (10 pts)

  • Write a program to simulate a Rock, Paper, Scissors competition between two players.
  • Your file should be named RPS.cpp and should be uploaded to Canvas when you are finished.
  • First, the program will welcome them to the competition.
Let's play Rock-Paper-Scissors!
  • Then, the program will prompt each user to enter his or her name.
Player one, please enter your name: _
  • Next, the program will ask each user (referring to him or her by name) to enter "Rock," "Paper" or "Scissors."
Jorge, please enter "Rock", "Paper" or "Scissors": _
  • Important: Note the use of the player name above and the " marks.
  • The program will determine who the winner is and output one of three options:
Rock breaks scissors!
Paper covers rock!
Scissors cut paper!
  • How will the program determine the winner? Hint: if - else if - else statements and using logical operators (&&, ||, !).
  • After outputting the above statement, the program will announce the winner by name:
Jorge wins!
  • In the case of a tie, the program should announce that the result is a draw.
The game is a tie.
  • Important: You are required to use logical operators (&&, ||, !) as part of your if  and else if statements.
  • The program should also prompt the user to decide if they want to play again (Hint: use a while loop).
  • Your program should work identically to the following examples:


Rock-Paper-Scissors Round 1!

Player one, please enter your name: Jorge
Player two, please enter your name: Jennifer
Jorge, enter "Rock", "Paper", or "Scissors": Rock
Jennifer, enter "Rock", "Paper", or "Scissors": Scissors
Rock breaks scissors!
Jorge wins!

Do you want to play again (y/n): y

Rock-Paper-Scissors Round 2!

Player one, please enter your name: Jorge
Player two, please enter your name: Jennifer
Jorge, enter "Rock", "Paper", or "Scissors": Scissors
Jennifer, enter "Rock", "Paper", or "Scissors": Scissors
It's a tie!

Do you want to play again (y/n): y

Rock-Paper-Scissors Round 3!

Player one, please enter your name: Wen
Player two, please enter your name: Amelia
Wen, enter "Rock", "Paper", or "Scissors": Rock
Amelia, enter "Rock", "Paper", or "Scissors": Paper
Paper covers rock!
Amelia wins!

Do you want to play again (y/n): n
Thanks for playing!