Project #40483 - C++

Q1) Create the first part of a Rock, Paper, Scissors game. Tell the user what you are playing and then ask them to choose either rock, paper or scissors. After they choose tell them what they chose. If they make an invalid choice, let them know. You must use a swich statement for this lab. Your text must exatly match the examples below: Example 1 with correct input: Let's play Rock, Paper, Scissors Enter 1 for rock, 2 for paper, 3 for scissors 2 You chose paper Example 2 with incorrect input: Let's play Rock, Paper, Scissors Enter 1 for rock, 2 for paper, 3 for scissors 5 5 is not a valid choice ------------------------------------------------------------------------------------- Q2) Create the second part of a Rock, Paper, Scissors game. Alter lab 6 so that the user keeps playing as long as they enter in 'Y'. Make this case sensitve; if they enter in lower case y the game will not continue. If the user enters in anything besides upper case Y the game will end. Your text must exatly match the examples below: Example 1 with correct input: Let's play Rock, Paper, Scissors Enter 1 for rock, 2 for paper, 3 for scissors 2 You chose paper Would you like to play again (Y for yes, N for no)? Y Enter 1 for rock, 2 for paper, 3 for scissors 1 You chose rock Would you like to play again (Y for yes, N for no)? N Example 2 with incorrect input: Let's play Rock, Paper, Scissors Enter 1 for rock, 2 for paper, 3 for scissors 5 5 is not a valid choice Would you like to play again (Y for yes, N for no)? y ---------------------------------------------------------------------------- Q3) The purpose of this project is to use cin to handle user keyboard inputs, use branching statements to control the flow of a program, and work on your C++ programming style. You will implement a rock-paper-scissors game. The computer will select rock, paper, or scissors randomly (and of course not reveal this selection to the player). The player will then enter 1 for Rock, 2 for Paper, or 3 for Scissor. The program will let the player know if she or he won. At the end of each round ask the player if she or he wants to play again. You must implement/include the following features in addition to the game play: Keep count of the number of times the player won and lost -- when the player chooses to stop playing, display these counts Keep a count of the number of times the player selects to play rock, scissors, and paper Implement the computer's selection as a random integer Objectives: Work on your C++ programming style Use boolean expressions Use branching statements to control the flow of a program Requirements: [5 points] Source code is documented correctly with name, lab section, and name of program [5 points] Your program source code must be neatly and consistently formatted (use GG=g in vim) [10 points] Program compiles and runs without error [10 points] Program handles user input with cin [10 points] Use at least one (1) switch statement and one (1) if statement [5 points] Computer generates an integer random selection [5 points] Prompt for and read in the player's selection [5 points] Compare the player's selection to the computer's selection [5 points] Display an appropriate message to the player to let them know whether they won or lost [5 points] Keep a count of the number of times the player selects to play rock, scissors, and paper [5 points] Prompt for and read in the player's choice about playing another round [5 points] At the end of play, display the number of player wins and losses Extra Credit - Out of all the games played let the player know who was the overall winner (computer or player). Also what the winning object (what object did the winner have the most wins with). +5 points -Tell the player what they should have chosen to win most of the time. For example, if the computer chose rock 7 out of the 10 times then the player should have chosen rock to win most of the time. +5 points ------------------------------------------------------------------------------------------------------------------------------------------------------------------- Q4) Each of the following three tasks can be solved using a loop: Ask user how many times they want the computer to print "HI". Print "HI" that many times. Question to ponder: If the user answers 0, is that problem? Print a countdown from 10 to 1, then print "Liftoff!" Ask the user for name. Don't stop asking until they type "Barney" (three loops for each of tasks)

Subject Computer
Due By (Pacific Time) 09/18/2014 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy