Thread: Help Plz

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    3

    Question Help Plz

    I have a project to do where the teacher gives us a .dat file and we have to put it into an array. this .dat file will be added to the directory the run with the program as a.out < scores.dat.


    Please tell me how to do this.

    Assignment:
    You job is to write a program that will read in the golf scores of several players in a golf game. You will then display some statistics about the scores. You will generate an average score and list those players who scored below the average (a good thing!) You will also provide the functionality to show the winning score. The player with the lowest score is the winner.

    Below is the main() function you must use in your program:
    int main()
    {
    int scoreList [MAX_PLAYERS]; /* Array to store golf scores */
    int numberOfPlayers = 0; /* Total number of scores entered */
    float averageScore = 0.0; /* Average golf score */
    int winningScore = 0; /* The lowest score */

    printf("\nWelcome to CMSC104's Golf Statistics Program!\n\n");

    /* Fill array with golf scores */
    numberOfPlayers = FillGolfScoreList (scoreList);

    Thankyou

  2. #2
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Nobody will do your homework for you.

    Post an attempt first, and point out the things you think are wrong, and people will offer help and tips to solve the problems. But do not expect the complete solution written for you.
    Double Helix STL

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    3
    no i dont need any help on my HW. I just need to know how to read from a dat file into an array. Everything else is just extra information.

    Thanks

  4. #4

  5. #5
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Also this could be useful
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can any1 plz make this assignment
    By jean in forum C Programming
    Replies: 17
    Last Post: 05-13-2009, 09:19 PM
  2. [Request] Need Help Plz
    By TylerD in forum Tech Board
    Replies: 4
    Last Post: 01-03-2009, 09:54 AM
  3. plz help here, noob actually .D
    By BjoRn3n in forum C++ Programming
    Replies: 1
    Last Post: 03-07-2005, 03:04 PM
  4. Anyone plz help me
    By Rose_Flowers in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-17-2003, 12:01 PM
  5. help plz plz
    By nsssn73 in forum C++ Programming
    Replies: 2
    Last Post: 06-03-2002, 08:44 AM