This is the project that my teacher assigned for me

The local baseball team is computerizing its records. You are to write a program using arrays that computes batting averages. There are 20 players on the team, identified by the numbers 1 to 20. Their batting records are encoded in a text file as following. Each line contains four numbers: the players identification number and the number of hits, walks, and outs he made in a particular game. Here is a sample:

3 2 1 1

The example above indicates that during a game, player number 3 was at bat 4 times and made 2 hits, 1 walk, and 1 out. For each player there are several lines in the file. Each player’s batting average is computerized by adding the player’s total number of hits and dividing by the total number of at bats. A walk does not count as either a hit or at bat when the batting average is being calculated. Your program prints a table showing each player’s identification number, batting average, and number of walks(Be careful: The player’s identification numbers are 1 through 20, but C++ arrays indexes start at 0).


I really need help on getting started. Anyone plz.

Recommended Answers

All 3 Replies

Member Avatar for Electrohead

Your program prints a table showing each player’s identification number, batting average, and number of walks(Be careful: The player’s identification numbers are 1 through 20, but C++ arrays indexes start at 0).


I really need help on getting started. Anyone plz.

Our program? So now you are expecting us to do it for you? Please don't post like this again! :evil:

I would be interested in helping out because I could use the experiance too. I ask only 2 things of you:
1. what have you done so far...where are you specificly stuck?
2. can you send over a few more of your assignments? I can never figure out what I should write for programs and such.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.