473,378 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

homework please help

don't know how to get started please help with this program.

rock,paper,scissors

We will write a program that multiple games of rock, paper, scissors: keeps a cumulitive score, quits when either player enters a 'Q' and declares an overall winner.

Input: Two players enter their respective plays at the prompts. Valid input is 'R', 'P', or 'S'. The program should accept bad input with an error message.'R' beats 'S'; 'S' beats 'P', and 'P' beats 'R'. The program should record each players total number of ins as well as the number of ties. Invalid plays are not counted unless you choose to do so.

The program should echo print the output and state the winner of each round. At the end, the scores are printed and a winner is declared.

The purpose of this program is to demonstrate subroutines (functions) and parameter passing using both pass by value (passing a copy) and pass by reference (passing such that the parameter may be changed).
Oct 24 '06 #1
1 1437
vninja
40
and are you trying to do this in C++? are there any other limits or parameters? do you need to error check for case sensitivity?

I see this game as a couple of switch and while loops. e.g.

loop:
(function) get player input and change it to numerical value
if q then let it "break;" loop and calculate winner
(function) get both numerical values and compair them
and have it return a 1 for win and 0 for loss to each person
end loop if game is over (first to 10 wins, q is pressed etc.).
(function) displays winner and total of wins/ties/losses for each person
Oct 24 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: | last post by:
I have this question for homework in an intro perl class, I was hoping for some quick help on this please...here is the question Using the Perl programming language, please prepare the following...
2
by: N3TB1N | last post by:
Let me try again. I could use some help with this assignment, even though my teacher does not grade assignments.but because I need to know this stuff for a test very soon, but haven't been in...
3
by: wiza | last post by:
if i want to implement the point type in terms of pair<int ,int>, and i also want to define a member variable named x to access the pair<int,int>::first member variable. how can i achiev this...
7
by: mastern200 | last post by:
For Homework, i have to debug a program (I am a noob!) it is a voting program where you put in the amount of votes a certain candidate gets and evaluates by showing how many votes, what percentage of...
1
by: mastern200 | last post by:
I need some homework help with an assignment due wed. I need to make a program where in this program calculates the average of a set of test scores. The program will ask the user how many scores...
8
by: garyrowell | last post by:
I have been at this programme for hours trying to work out what is wrong. Any help would be very much appricated. Here is the breif I received. The program This week you are going to write three...
2
by: DonE | last post by:
Help me please. I am having problems with my homework assignment. We are to create a product class that hold the item number, the name of the product, the number of units in stock, and the price of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.