DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: I need help getting started

  1. #1
    need help with c++ review ? Guest

    I need help getting started


    The game of bowling consists of 10 frames. Each frame has two balls. A strike
    occurs if the balll knocks down all 10 pins on th first ball of the frame.
    A spare occurs if the first ball is not a strike, and the second ball knocks
    down any remaining pins. A strike adds the next two balls to the frame for
    a possible 30 points. A spare adds the next ball to the frame. Write the
    required code to let the bowlwer input his score on each of 10 frames, then
    tell the bowler the final score (of possible 300 points). The tenth frame
    may required 1 or 2 additional balls if it has a strike or spare.


    if someone could just give me some starting off pt that would be great...

  2. #2
    jonnin Guest

    Re: I need help getting started


    create a 2d array for the scores, with an extra field for the total (can be
    used to hold the extra 10 frame ball, as well):

    int scores [11][3]; //11 scores, 2 balls each, +subtotal, see hack above.

    Create a function to load the scores, and one to total them.

    void getscores (int ** scores);
    void totals(int **scores);

    Check that the total is <= 10 each pair as they are entered.

    menu it up in main, and you're done.

    Or something like this.


    "need help with c++ review ?" <cmbsmu@aol.com> wrote:
    >
    >The game of bowling consists of 10 frames. Each frame has two balls. A strike
    >occurs if the balll knocks down all 10 pins on th first ball of the frame.
    >A spare occurs if the first ball is not a strike, and the second ball knocks
    >down any remaining pins. A strike adds the next two balls to the frame for
    >a possible 30 points. A spare adds the next ball to the frame. Write the
    >required code to let the bowlwer input his score on each of 10 frames, then
    >tell the bowler the final score (of possible 300 points). The tenth frame
    >may required 1 or 2 additional balls if it has a strike or spare.
    >
    >
    >if someone could just give me some starting off pt that would be great...



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center