473,657 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

homework please help

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

rock,paper,scis sors

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 1451
vninja
40 New Member
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
1794
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 script: Description Given a table 'mailer' that has a column: emailaddr varchar(255) Create a new table to hold a count of email addresses by their domain name limited to those domains that have at least 100 addresses in the list and add a...
2
2276
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 class for awhile and don't know what I'm doing. I have included my (probably wrong) answers for the first few questions. It would be great if someone could tell me what is missing or what I need to work on at least just for the first few. I...
3
1370
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 goal?i dont want to use memeber function.
7
2054
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 votes, and total. Problem is that it rounds everything and doesnt show what it is supposed to show. I got this far... Please help! #include <iostream> #include "string.h" using namespace std; int main() {
1
1578
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 there will be. The user will be prompted to enter score 1, score 2, etc. After the scores are entered the computer will print the total number of points, the average score, and the number of scores. The program will ask the user if he/she wants...
8
29161
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 classes: Card.java, Deck.java and DeckTester.java. The specification for each class is given below. Card.Java This is a simple class that represents a playing card. Card has two attributes: • rank which is a String that represents the value...
2
1423
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 each unit. Here is my problem. I have written the program ( I use netbean) and I have encountered plenty of errors. The error messages that I get are as follows: illegal start type cannot find symbol operator cannot be applied assignment to...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.