Game Score records app

May 3 2014 4:32 PM

A Game maintains score records for its Players in a comma delimited sequential file “scores.txt” with the record structure outlined below.

An example file. It contains the following sample data:

G001,Sarah, Female,280

G002,John,Male,650

G003,Laura,Female,720

scores.txt record structure

Field Name

Type

Player Number

String

Player Name

String

Gender

String

Score

Integer

A menu driven program is required to allow the user create reports and/or search the file..

Menu Format

Menu

1. Player Report

2. Score  Report

3. Search for a Player

4. Exit

The user shall be able to create report and search as often as they like. The program will terminate when exit is selected.

Report Format (for sample data)

Player Name Score Star Rating

 
 


Sarah            280 *

John           650 ***

Laura            720 ****


Top Seller Laura

Average Score 550

Alongside the score, you must display the appropriate star rating for each player, use the table below do to determine the citation.

Table 1

Score

Star Rating

Less than 400

*

between 400 and 599

**

Between 600 and 699

***t

Between 700 and 999

****

Greater than 999

*****

Score Report

This report will detail the number of players that are achieving scores in the specified score categories and also the number of males and females within these ranges (use an array here)

Score Range   Count: Female:        Male

Under 400 :1     :1:             0

400-599 0 0 0

600-699 1 0 1

700-999 1 1 0

1000 + 0 0 0

Totals 3 2 1

Search

Allow the user enter a player number, the program will then search the file, and display the player name, and the score for this player. If the player is not found display a message stating “No match found”.