View the step-by-step solution to:

This program uses the material from chapters1-6. The .cpp file should be submitted by the due date and a hard copy should be brought to class on...

This program uses the material from chapters1-6. The .cpp file should be submitted by the due date and a hard copy should be brought to class on April 16 (due at start of class). The general instructions should be followed as before. In addition, a flowchart should be constructed and also turned in April 16. See problem 24 on page 378 of the text for the rules of the game. All input will come from the monitor and output will go to the screen. The results (see below) will go to the screen and to an output file (named with your last name).

The program will let the user play the game rock-paper-scissors with the computer. Here is a sketch of the program:

- display a message that the game is rock-paper- scissors.

- ask the user if they want to play - if no, then stop.

- if yes, continue the game and loop through the steps until the user chooses "no".

- call on a function named userPick that will display a message to pick one of the items: 1 for rock, 2 for paper or 3 for scissors and will return your pick.

- call on a function computerPick to get the computer's choice. This function will use a random number generator to produce a 1, 2, or 3 result which will be returned.

- a function displayResult should receive your pick and the computer's pick and will display the results.

- go back to the step that asks the user if they want to play.

Here is possible output from two games played:

Here are the results from the game Rock-Paper-Scissors

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

The computer picked rock

The user picked paper

The winner is the user

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

The computer picked paper

The user picked paper.

The result is a tie.

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

Done. Game created by USER

Top Answer

Sample Output of the game is as follows: ***Welcome to the game of Rock-Paper-Scissors*** Enter Y to play the game: y Choose:... View the full answer

Capture.PNG

1 comment
  • hey it doesn't have the yes or no at the beginning in the terminal
    • landaverde112
    • Apr 12, 2018 at 10:57am

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online