|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming | |
Please delete, question solved
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | ||||||||||||
|
New to Overclock.net
![]() |
Was going thru sum programming papers and saw this, so need some tips on how to write it
In the kids game “Paper, Rock, Scissors”, each player chooses one of the three and the winner is determined by the relationship between the two choices. “Paper covers rock”, so paper wins, “rock breaks scissors”, so rock wins; and “scissors cuts paper”, so scissors wins. If both choose the same, it is a tie and no one wins. Requirements. a) Write a function MachineChoice that returns a character for the choice of (p)aper, (r)ock or (s)cissors. b) Write a function PlayGame that will accept three parameters; the machine’s choice, the player’s choice and the score. This function should also return the score. c) Write a program to play the game against the computer until the player enters q to quit. Sample Output. Choose (p)aper, (r)ock, (s)cissors or (q) uit: p The machine chooses scissors. YOU LOSE! Your score -1 Choose (p)aper, (r)ock, (s)cissors or (q) uit: s The machine chooses scissors. IT’S A TIE! Your score -1 Choose (p)aper, (r)ock, (s)cissors or (q) uit: p The machine chooses rock. YOU WIN! Your score 0 Choose (p)aper, (r)ock, (s)cissors or (q) uit: p The machine chooses rock. YOU WIN! Your score 1 Choose (p)aper, (r)ock, (s)cissors or (q) uit: q THANK YOU FOR PLAYING WITH ME …..
__________________
WE HAVE THE 100M AND 200M RECORDS!!!! 9.58 AND 19.19 TOP THAT!!!!! Offical Member of the AM2/AM2+ Club PhenomIsts GPU Validation Core 860mhz, Memory 1120mhz Highest overclock3.4Ghz 3.324ghz
Last edited by Jamar16 : 4 Weeks Ago at 01:00 PM |
||||||||||||
|
|
|
|
|
#2 (permalink) | ||||||||||||||
|
4.0 GHz
![]() |
I'm not sure copy-pasting the assignment verbatim is the tactful way of going about things.
__________________
3DMark06: 19091 - 3DMark Vantage: P15264 - SuperPi: 10.968s Programming Quote of the Day: Bjarne Stroustrup: Quote:
|
||||||||||||||
|
|
|
|
|
#3 (permalink) | ||||||||||||
|
New to Overclock.net
![]() |
not an assignment, just going thru sum papers and i saw this one, just wanted tips
__________________
WE HAVE THE 100M AND 200M RECORDS!!!! 9.58 AND 19.19 TOP THAT!!!!! Offical Member of the AM2/AM2+ Club PhenomIsts GPU Validation Core 860mhz, Memory 1120mhz Highest overclock3.4Ghz 3.324ghz
|
||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|