User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,508 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,673 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 515 | Replies: 4
Reply
Join Date: Sep 2007
Posts: 3
Reputation: icecube is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
icecube icecube is offline Offline
Newbie Poster

tenis match pseudo

  #1  
Sep 27th, 2007
Hi I am completely new to the programming and I got 0/10 on my last algorithm in pseudo code. I need to write an algorithm using pseudo code to score a tennis match. The algorithm takes two scores and the player who won the point as input and retuen the new scores. Any help?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Posts: 6,515
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 489
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: tenis match pseudo

  #2  
Sep 27th, 2007
>Any help?
Yes, plenty. But you'll have to make an attempt first. No effort on your part results in no effort on our part.
I'm here to prove you wrong.
Reply With Quote  
Join Date: Sep 2007
Posts: 3
Reputation: icecube is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
icecube icecube is offline Offline
Newbie Poster

Re: tenis match pseudo

  #3  
Sep 27th, 2007
Sorry about that, here is what I have managed so far.

Prompt user for 3 values
int score_1, score_2, player;

player = 1,2;


if (winner = 1) then
score_1 = score_1 +15
else
score_2 = score_2 +15

if score_1, score_2 >= 40 then
game
End if;

I'm thinking I use else so if player 2 wins then he gets the +15 score instead of adding another if statement.
Last edited by icecube : Sep 27th, 2007 at 12:34 pm.
Reply With Quote  
Join Date: Sep 2004
Posts: 6,515
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 489
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: tenis match pseudo

  #4  
Sep 27th, 2007
Is this a running score program? Are you breaking the match down into sets and games? It's possible that you're oversimplifying, but I can't be sure without a more detailed description of the problem.
I'm here to prove you wrong.
Reply With Quote  
Join Date: Sep 2007
Posts: 3
Reputation: icecube is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
icecube icecube is offline Offline
Newbie Poster

Re: tenis match pseudo

  #5  
Sep 27th, 2007
It's broken down the specific set so that if you entered 15 15 2 the output would be 15 30 and then you continue input until a player has won the set. Once the set if finished it outputs game.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 3:46 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC