#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    1
    Rep Power
    0

    Is there anyone can work out this code?


    Suppose you have been recently hired by an athletic department to (eventually) develop computer-based
    tools to perform biomechanical analyses of athletes (similar to that described in the 2012 Olympics article
    you read). However, before developing such biomechanical computer-based tools, the department wants you
    to first write a computer program to help with soccer team tryouts (as many more athletes are trying out
    this year than in prior years). To help deal with the abundance of athletes trying out for the team, the coach
    has decided to perform the tryouts in two rounds, with the first round being more objective (and thus more
    easily performed with the help of a number of assistant coaches and a computer program) than the second
    round. In particular, in the first round, a number of assistant coaches will time each of the athletes in 10
    events. Each athlete must meet a qualifying time in at least eight of those events to make it to the second
    round. More details about this round appear in the next section. In the second round, more traditional
    tryouts will be performed (including careful examination of each athlete’s performance during drills and a
    game). You have been specifically asked to write a computer program to help the assistant coaches properly
    assess each athlete in the first, more objective, round to determine if he/she qualifies for the second round.
    You do not need to help with the second round of tryouts as this round is more subjective in nature.
    One of the assistant coaches will escort each athlete to 10 events (e.g., 100 m run, kicking a soccer ball at a
    target, completing a particular passing drill). The events will be presented to each athlete in a random order.
    At a given event, the athlete will have three attempts to achieve a time equal or less than the qualifying
    time. The qualifying time for each event appears in Table 1. As soon as an athlete achieves the qualifying
    time (or better), the athlete will have “passed” that event and he/she will directly move on to the next event
    (and not finish any remaining attempts that may remain). For example, if an athlete achieves the qualifying
    time in the second attempt, he/she will not complete the third attempt. If the athlete’s time is larger than
    the qualifying time on all three attempts, the athlete will have “failed” the event. The athlete is required to
    pass 8/10 events to qualify for the second round of tryouts. The athlete will stop competing in the events as
    soon as his/her qualification status is known. For example, if an athlete passes the first eight events, he/she
    will qualify and will make no attempts on the last two events. Similarly, as soon as an athlete fails three
    events, he/she will not qualify and will make no attempts on any of the remaining events
    Table 1: Qualifying Times for the 10 Events
    Event Qualifying time Event Qualifying time
    Event 1 5.4 s Event 6 3.4 s
    Event 2 7.2 s Event 7 26.0 s
    Event 3 15.0 s Event 8 35.0 s
    Event 4 25.0 s Event 9 42.0 s
    Event 5 60.0 s Event 10 62.0 s
    Your task
    Your task is to write an interactive C program to guide an assistant coach through the first-round tryout
    procedure of a single athlete so as to follow the rules indicated above. The coach will start this program (e.g.,
    by running the program remotely through his/her tablet) as soon as the athlete begins his/her tryout. The
    program should indicate to the coach the first event for which the athlete will be timed and the associated
    minimum qualifying time. The program should also request that the user (the assistant coach) enter the
    time (in seconds) of the first attempt of this event. The coach will then time the athlete’s first attempt
    at the indicated event using a traditional stop watch (not using your program) and will enter the time
    achieved using the keyboard. If the athlete does not make the qualifying time on this first attempt, the
    program should request that the user enter the time (in seconds) of the second attempt. If the qualifying
    time has still not been met, the program should request that the user enter the time (in seconds) of the third attempt. Once the event is completed, the program should indicate whether the athlete “passed” or “failed”
    the event and specify the next event. This process should repeat until the athlete’s qualification status is
    known (e.g., by passing eight events or failing three events). The program should then specify whether the
    athlete qualifies for the second round of tryouts and provide a summary of the number events passed and
    the number of events failed.
    You have a lot of flexibility in how you will exactly implement the this C program, but the following
    provides some additional general requirements:
    • You must implement your program in the file named hw1.c within your hw1 folder in your homework
    directory. Please note that this is an individual assignment and you are correspondingly not allowed
    to discuss your program with anyone but the instructor and the TA’s.
    • The program must be “interactive” in the sense that the program will guide the user by displaying
    instructions/results to the screen what event/attempt the user should time next and by waiting for the
    user to enter the corresponding time. It should be obvious to user what they should do when running
    your program.
    • Each time the program is run, the order in which the events are presented to the user must be different
    (so you will need to be able to randomly generate a permutation of the event order). Please note that
    generating such a random permutation is one of the more challenging aspects of this assignment, so
    it is strongly recommended that you get your program working with a fixed order (e.g., “Event 1,”
    “Event 2,” . . . ) before modifying your program to enable the events to be presented in a random order.
    If you do not generate a random permutation of events, you can still receive up to 90/100 points for
    the assignment (see grading guidelines).
    • The program must not request that the athlete complete any unnecessary attempts of any event. For
    example, if the athlete achieves the minimum qualifying time (or better) on an event, the next event
    should immediately be presented to the user rather than requesting that the user enter the times
    associated with additional attempts. As another example, once it is known that an athlete will qualify
    or will not qualify, the program should not request that any times be entered for additional events.
    • You must avoid repeating a large amount of code (effectively meaning that you will most likely need
    to include loops, arrays, and/or functions). For example, please do not explicitly write out all the code
    for each event separately – use some type of loop.
    • In addition to having a standard documentation block and providing comments throughout your program, you must provide high-level pseudocode at the level of detail that someone with sufficient C
    knowledge would be able to implement your program.

    Comments on this post

    • ptr2void disagrees
    • bdb disagrees
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,406
    Rep Power
    1871
    > Is there anyone can work out this code?
    Yes!

    Now the real question is why you think you deserve special consideration from the universe by getting someone else to do your homework, whilst your classmates do it for themselves (and learn something in the process).

    > Please note that this is an individual assignment and you are correspondingly
    > not allowed to discuss your program with anyone but the instructor and the TA’s.
    So you can't play the "nobody to help me" card here.
    Go and pester them for help and advice - they're being paid to support you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,116
    Rep Power
    1803
    Is there anyone who could be bothered to even read the assignment dump!?
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,222
    Rep Power
    2222
    Originally Posted by clifford
    Is there anyone who could be bothered to even read the assignment dump!?
    Yes. His instructor when he Googles the forums to discover which of his students are attempting to commit plagarism. We've seen that happen here before.

IMN logo majestic logo threadwatch logo seochat tools logo