Please some body add the solution help me................

**For this problem you will create a program to display a plain text ‘scoreboard’ for a match of the game of tennis. If you are not already familiar with the scoring system in tennis you may wish to do some of your own research on it, but I have briefly described the scoring system below.**
**The program you write must provide a running score for a complete match of 3 sets. In the first two sets, a player wins the set by winning 6 games and being two games ahead. After such a set is won the score might be 6-2 or 6-4 or 6-1 etc. If the score reaches 6-5, an extra game is played. If the score is even, at 6 games each, the set is decided by a seven point tiebreak; the first player to obtain at least seven points in the tiebreak, with a two point advantage, wins the set. When a set is won by a tiebreak the set’s score is shown as 7-6.**
**The last set is played to ‘advantage’, which means to win it a player must win at least 6 games and be two games ahead of their opponent. If the score is even, at 6 games each, the set is decided by continuing to play normal games until one player is two games ahead of the other. An advantage set is shown on the scoreboard as 9-7, or 7-5 or could even be 335-333 (after which both players expire of exhaustion).**
**Each game consists of four points, the first called ‘15’, the second ‘30’ the third ‘40’. A player who has reached ‘40’ with their opponent on less than ‘40’ can win the game with one more point. However, if the two players are both on ‘40’ (called ‘deuce’ and shown as ‘40-40’) play continues until one has a two point advantage. From deuce, the next point gives the winner ‘Ad’ (short for advantage) and the score is shown as ‘Ad-40’. If the other player wins the next point the score returns to deuce again. When a player leading ‘Ad-40’ wins the next point they win the game.**
**Which player is serving at any stage does not affect the scoring system. If desired, an initial server could be chosen randomly, with serving alternating game by game throughout the match. Serving only affects the vocalisation of the score, without affecting the score on the scoreboard.**
**Requirements**
**Create a TennisScorer class, whose objects will score a tennis match as described below.**
**•     When the program starts a tennis scoreboard will be displayed on the standard output as**
*** Player 1: 0 0 0**
**Player 2: 0 0 0**
**where the first column optionally shows who is serving, the second shows the players’ names, the third their score in sets, the fourth their score in games in the current set and the fifth their score in points in the current game.**
**•     The program will randomly generate a winner for the next point. The scoreboard is then updated and displayed again. For example, after many points the display might contain many instances of the output scoreboard including the following.**
**Player 1: 1 3 40**
*** Player 2: 0 5 40**
**Player 1: 1 3 Ad**
*** Player 2: 0 5 40**
**The behaviour of generating a winner, updating the score and displaying it should continue as long as the match lasts. This will produce a large amount of display, only a sample of which should be included in your listing. The displayed output should be captured to file.**
**•     When a player has won 2 sets the program should display the name of the winning player and terminate.**
**If you cannot complete the above problem you should submit a partial solution which only scores points or scores points and games but not sets, or doesn’t show who is serving. You may also add add*itional features as described below.*

baxterbbb wrote:
give me some coding hint man.............The assignment tells you to write a class TennisScorer. Write an empty class TennisScorer.
What does a TennisScorer object need right at the start to be able to function?
The player names. Therefore provide a constructor that takes two String arguments.
Now every time one of the players wins a point, your TennisScorer object needs to be informed, so that it can adjust its internal state. Provide a method, let's say updateScore() with parameters describing somehow who won the point. Or, if you wish, two methods, firstPlayerPoint(), secondPlayerPoint(). Also provide a toString() method (check Object.toString()) so that someone could extract the information for display purposes. What is the internal state? Maybe some instance variables called: p1Sets, p2Sets, p1Games, p2Games etc.
Now write a main() method that exercises all this: creates the TennisScorer object, goes to a loop and generates a random value indicating which player scored, feeds the TennisScorer with the value, calls toString() and displays the result.

Similar Messages

  • Please if anyone know the solution help me

         i'm new iphone holder then i heard about the new software that ver 5.0.1 and when i connected my iphone with itunes i get new update available and i download it then it automatic updated my i phone the problem is when i Finished upgrading it locked the phone i tried alot to solve it but thier is noting work
    and i tried to look for some one who know how to unlock my iphone they told me that u have to wait one month for geting the solution *** is this
    factory lock :@ why ?????
    please anyone had faced the same problem advise me what to do ?

    u mean i should connect my phone with app thats for jillbroken to solve the problem and it will be useful and it will work without problem hhhhh i dont know how to use jialbroken
    i wish i do
    can u send me steps to go with it
    <Email Edited by Host>

  • My iphone 4 is dislabed at the moment please some body help, my iphone 4 is dislabed at the moment please some body help

    my iphone 4 is dislabed at the moment please some body help, my iphone 4 is dislabed at the moment please some body help

    Do as the manual says and restore the iphone.

  • How to add the search help in Screen programming "F4" help

    i add the input field
    se51 --> layout and now want to add the search help with these field,
    please help me... in this way.

    Looks like u r a novice in Mp programming.
    Please look at some demo programs in SAP which can teach u the basics of Module Pool programming . Use Demo* in se38 and search first in sap and then in some other sites.
    The above thing can be done in Process on value request .
    Br, vijay.

  • Encountered an error when attempting to open Lightroom for the first time. Went to Lightroom Help and searched for the error "An error occurred when attempting to change modules". Non of the solutions helped. what now?

    Encountered an error when attempting to open Lightroom for the first time. Went to Lightroom Help and searched for the error "An error occurred when attempting to change modules". Non of the solutions helped. What now?

    I am getting this error message as well. I have just downloaded Lightroom recently. I try to click on Lightroom / preferences....and nothing happens. I tried to uninstall and it is greyed out so I can't do that either. Suggestions? Please help?

  • Can any body give the solution

    Hi,
    Can any body give the solution for my queries?
    A two level PO Release workflow is required to support the Import PO Release Approval business process.  Forecast and Replenishment will transfer orders to SAP ERP. Purchase orders will be blocked upon creation based on the document type. If the document type is ZIMP=Import Purchase order, the order will have to go through a release process described below:
    When a PO is created it will be automatically blocked based on the document type ZIMP and a workflow will be triggered to the stock planner responsible to work on the containerization of the order. The stock planner will receive an email notification and an SAP workitem to generate and send a report to the vendor to get the order containarized. Once the report has been sent the purchase order will be relased with code 01:In containerization.
    01/29/07: The containerization report needs to include: PO number (EKPO_EBELN), Article number (EKPO_MATNR), Vendor part number (EKPO_MFRPN), Description (MKAT_MAKTX), Quantity in Base unit of Measure (EKPO_MENGE) and Quantity in BuyPack unit of measure and Net price (EKPO_BPRME). This report should be generated out of SAP as part of the release code 01 of the workflow. The report will be downloaded to excel by the approver.
    After the order is released with code 01, a second workitem will be triggered to the stock planner who will use SAP to execute the workitem. The work item will allow the modification of the PO (if needed) with the containerized quantities and the release of it using release code 02:Release. The second work item for release code 02 does not need to trigger the report. 
    Substitutions:  If there is a substitute for the approver (i.e.an admin), that person will be included on the list of approvers.
    Emergency approvals:  A position not in the approver hierarchy (i.e., Finance Marketing Manager) can approve the request outside the loop of the approval workflow.
    these are the questions i have from the above requirement:
    Is the containerazation report which has to be include few fields has to develop as a report or has to be done in workflow?
    Can any body explain how the order is containerized and what is containerization?
    Where can i see the release codes in the me21n?
    If there is any queries regarding this requirement to shoot Functional Spec owner.Please Send to me.
    Give the Solutions ASAP.
    Regards,
    Naidu.

    See my response in Can any body give the solution.
    Rosaiah and others: please quit starting multiple threads for the same request. It is just annoying! In my opinion it is also disrespectful to everyone else in the forum, but that's my personal opinion.
    You could either have edited your original request, or posted a reply to it with the additional information.

  • Do some body have any solution

    I got a nokia 6300 it fell in water some 4 months back and i got it cleaned and placed in sunlight for an hour after that every thing was all right and now i swithed off my mobile and it is not starting again when i went ot nokia care they are saying that there is damage created dut to the water in side and the chips and even after replacement there is 50 50 chances of the mobile fuctioning i.e. it may work or not please suggest me is my mobile of no use after falling in water is any body have any solution to my problem

    Any mobile phone is a sensitive electronic device. If you drop it in water then all bets are off as to its longevity.
    The only solution is for you to buy another mobile phone.
    And to avoid dropping it in water...
    Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!

  • How to add the custom help exit to search help in SE11

    Hi All,
    I am trying to add the ZF4IF_SHLP_EXIT_EXAMPLE to search help exit in SE11 for search help LART . But system is asking for the access key.
    Is there any way we can achieve this with out using access key?
    Please suggest me.
    Regards
    Subhaskar

    Hi,
         To add a Search help exit goto SE11 -> in Search help option enter 'LART' -> click on display.
    once you have entered in you will have to click on change button. This will give on information message first, then it will ask if you have to maintain in the original language itself(only if you have logged in with any language other than DE). You can select your option in that then you will be able to view the same in EDIT mode. now you can go ahead and add your search help exit.
    Hope it helps.
    Thanks & Regards,
    Praveenkumar T.

  • Unable to add the F4 help data description in field of ALV

    Hi All,
    I want to create a column based on the F4 help data description which i has mentioned below images..
    I want to create a new column next to G/L account number column.
    I want to add F4 Long Text field to a column..
    Please help me how to pass the F4 help data from F4 to New column???
    Thanks in advance..
    Regards,
    Kiran

    Hi Aruna,
    Thanks for replying.
    Actually my requirement is , I use to add G/L number on F4 help, there I am having G/L account number with G/L account Description next to it ( LONG TEXT), I want that description should come in separate column next to G/L account.
    After giving the G/L account number, its description will populate next to its Column...
    The column will looks like in this Screen shot.
    I added the new Column called G/L account Description, But how to pass the field value from F4 search data to that Column??
    pls help me with this.
    Regards,
    Kiran

  • Please save us from the Community Help threads

    In the Illustrator forum we are getting some silly threads that no one know what to do about. It seems to be posted by Community Help with an article that the first post seems to be a question about, but it is all completely unintelligible to us, the natives, and the supposed first poster seems to have no clue of being transferred.
    So far, we have two threads:
    http://forums.adobe.com/message/4205555?tstart=0#4205555
    http://forums.adobe.com/thread/962694?tstart=0
    Please spare us, we have enough to do with providing real community help.
    For some (or no) reason I was unable to post a reply in the other thread,
    http://forums.adobe.com/thread/955582?tstart=0

    Jacob Bugge wrote:
    http://forums.adobe.com/message/4205555?tstart=0#4205555
    What I see is someone who has asked the simple, straightforward question, "What are the best practices for creating web graphics?", then the natives going on to discuss anything but the best practices for creating web graphics.
    Has something changed since it was posted?  Did it get edited?
    Frankly - and I'm sorry to be blunt - if I had asked that particular question then been redirected to a discussion of wonga-wonga birds, dirt track minds, snow, and other nonsense, I'd just turn away quite disappointed with the quality of the help.  And, to make matters worse, the entire blob of noise is now tied to the Adobe Help page for Illustrator.
    I see that Steve just a little while ago posted the very pertinent comment:  "Mods might need to delete the off topic posts, so that the help files only have relevant info."
    Was there something wrong with assuming Anup Rav genuinely wanted more information and/or was just commenting on the extreme terseness of that page and either:
    A) Addressing the question directly?
    -or-
    B) Just not saying anything so that someone else could address it?
    Even the following would have been more helpful...
    C) This help topic certainly does seem a bit light on information.
    -Noel

  • Why i can not use the ink 650 in the 3515 hp eprint,some body out there to help me out please...

    why i can not use the ink 650 in the 3515 hp eprint?somebody out there to help me please??

    Hi @ronjhay ,
    Thank you for taking the time out of your day to ask that question on the HP Forums today!
    I am having a bit of trouble understanding exactly what it is that you are asking, I apologize. Are you trying to use the number 650 ink cartridge in the printer? And it isn't fitting and you are asking why it isn't?
    Please clarify. Look forward to hearing back from you!
    I worked for HP.

  • Please Some body Help

    I have mac Book pro i recently format hardisk and install windows 7 and now i have only windows 7 on my mac book pro now i want to remove windows 7 and only install MAC OS x lion but i dont know how can I.If any body can help me?

    The only solution I see is for you to purchase a Mac OS X 10.6 Snow Leopard DVD ($29)  from Apple and then purchase a Lion upgrade ($29) from the App store if you want Lion. If you wish to go directly to Lion then purchase the OS X Lion USB thumb drive ($69). 
    There is no free solution that I am aware of.
    Once you get the Mac back then make a bootable clone to an external drive with Carbon Copy Cloner or SuperDuper. This way you will have a readily available solution to many unseen problems.

  • Please some body help. URGENT !!!

    i have a powerbook G4 titanium
    everything works great except the lcd
    the lcd is really dark now.
    its really hard for me to see the programs
    please somebody help me....

    Welcome to Apple Discussions!
    How old is the clock battery?
    Have you tried setting the brightness through the Displays System Preferences?

  • If some one have the solution of my problem tell me plzzzzzzzzz

    hi
    i m Adnan from Pakistan
    there is a conflict in my BB 8100
    if i add countery code of any of my contact
    when i receive a call from that specific contact my BB 8100 will not show its Name but only Number
    and if i delet countery code then my BB 8100 do not show the name of that specific contat in my sms inbox
    i m receiving both sms and calls regularly
    so its a big problem for me
    will any one please help me
    Regards
    Mian Adnan
    Solved!
    Go to Solution.

    1. Make sure you set your own country code at Phone dialer Screen > Options > Smart dialing.
    Set your Country Code in this format: "+xx" where xx = your country code. Some countries have two or three digit Country Codes. Do not place the '+' in your contact's entry.
    * In the US, set this Country Code as "+1", and place your loca area code in the proper box (this normally the default setting in a new BB).
    2. At the same location, change the National Number Length to the number of digits for your country (since some countries will have less than 10 as set as the default in the BB). Find out the total digits, minus the country code. Do not place the '+' in your contact's entry.
    * For example, some countries have a total number to 8 (plus 3 for country code). You would enter "8".
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Can any body give the solutions for frequently asked questions

    can any body help me in the following questions.
    1 .  what is a conversion routine .
    2.  how do you create fonts and colors in the sap scripts.
    3. how do u upload a logo in a smart form .
    4. can u  get both landscape and portrait in same layout , if yes how .
    5. what is the functional module used to upload excel file .
    6. what is the functional module used to get longtext in the report for purchase orders and sales orders
    7. what is the even alternative to initialization where authorizations are declared to run a report.
    8. how the exceptions with in function module rise when they are uncommented.
    9. how do u translate the report to other than system language.
    10. how to debug a sf without putting a stop point.
    11. what is the procedure to handle the data upload using table control in bdc.
    12. what is the procedure to access the standard text into scripts.
    13. what is the procedure to send the smart forms as a mail .
    14. in bdc how can u handle the table controls .
    15. there are 10000 records in a flat file and first record contains error , if I upload to the bdc program , and run in bdc session method what will happen.
    16. how can u attach the transport request for scripts .
    17. tools to transfer requests to quality control or production system.
    thanks in advance.

    Hi,
    Pls check service.sap.com/certification or your local education center at www.sap.com/education
    Eddy
    PS. Reward the useful answers and you will get <a href="http:///people/baris.buyuktanir2/blog/2007/04/04/point-for-points-reward-yourself">one point</a> yourself!

Maybe you are looking for

  • Updated itunes now it won't open on my computer

    I tried to update itunes so I could sync some music I bought on my computer to my phone, because my phone wasn't letting me download it directly. Now iTunes won't open. I've tried uninstalling and reinstalling it twice, but each time it will not open

  • Problem in Printing cheques in Automatic Payment Program

    I have configured a APP and I am running a payment program for trial by using transaction F110. The same is running through and creating a cheque print job in the spool. But when I am printing a single cheque the system is taking double printouts. Wh

  • Document will only open in read-only mode

    I created a .pdf document from a Word document in Adobe Acrobat Professional 10.1.1. When I open the .pdf it will only open in read-only mode.  I want to change the security settings to prevent editing before I send it out but the File>Properties>Sec

  • Know about sap xi

    hi expects, i want know about sap xi?and how is openings in sap xi.                                                                                 thank you

  • File (xml) xi IDoc

    The messages in the messeage monitoring are showing an general error and the error type is XI_J2EE_ADAPTER_XI_HANDLER. Can you please suggest what needs to be done? Best Regards Fatih