LAB3 

 

Arithmetic, I/O streams, If-statements, (Case-statements)

 

Project:

Create a program which will read the game scores of players; and then compute their level.

 

Specifications:

Write a program to perform the following tasks:

  1. read the Data from an input file (game_scores.txt) .
  2. the Data includes 3 player names and 3 game scores per player
  3. for each player compute the weighted average of the game scores as follows:

20% for first game, 30% for second game, 50% for last game

Earlier games are worth less in the final total score; later game is worth more.

  1. for each player determine and print the level of his/her expertise based on the weighted average as follows:
    1. average game score > 2000:  expert
    2. 1800 <= average game score < 2000: master
    3. 1500 <= average game score < 1800: advanced
    4. 1000 <= average game score < 1500: intermediate
    5. < 1000: beginner
  2. for each expert player print: "Congratulations ! You are an expert! "
  3. for each player that is master or advanced print : "Good Job!"
  4. for each player that is a beginner: "Keep on practicing!"
  5. Display the results neatly to both the monitor and the output file, game_totals.txt. 
  6. Run the program 2 times; for each run change the names and the scores in the data file.
  7. Print out the  Program, the Input File and the Output File.

 

           

Additional Notes

The Input File should include the following data for each of the 3 students: Game1 score, Game2 score, Game3 score, Name 

 

Sample Data File

 

700      800      1000    George

990      1250    1300    Minnie

1200    1500    2200    Paul

 

Output Data File

Levels of Players

 

George            -beginner-   Keep Practicing! 

Minnie             -intermediate-

Paul                 -advanced-   Good Job!

.............................

.............................

 

 

 

* Please remember to include Comments.