PDA

View Full Version : Qbasic programming player's stats


Simonne
Nov 10, 2009, 09:17 AM
Generate a report using the provided data file. The file contains hitting statistics for baseball players from a few seasons ago. The report will consist of batters' name, total times at bat, total hits, and final batting average. Computations are as follows:
1. total at bats = plate appearances - walks
2. total hits = singles+doubles+triples+home runs
3. batting average = total hits/total at bats

Input data file Information:

INPUT FILE DESCRIPTION File name: Stats.txt
FIELD DESCRIPTION DATA TYPE DECIMALS
Name Character 0
Plate Appearances Numeric 0
Runs Numeric 0
Singles Numeric 0
Doubles Numeric 0
Triples Numeric 0
Home Runs Numeric 0
RBIs Numeric 0
Stolen Bases Numeric 0
Walks Numeric 0


Note: The first record in the input file contains field names.





the data file has a list of players with their stats. If someone could just help me understand what I am suppose to do that would be extremely helpful :)
thank you

Simonne
Nov 10, 2009, 09:25 AM
Here are just some of the players I need to use



Name,Plate Appearances,Runs,Singles,Doubles,Triples,Home Runs,RBIs,Stolen Bases,Walks
A. Pujols,670,137,117,51,1,43,124,5,79
T. Helton,694,135,122,49,5,33,117,0,111
B. Bonds,538,111,65,22,1,45,90,7,148
E. Renteria,652,96,133,47,1,13,100,34,65
G. Sheffield,662,126,112,37,2,39,132,18,86

Perito
Nov 10, 2009, 10:11 AM
The input information usually would come from a data file. Write the data into a file. Open that file and read it. Use commas to separate the fields. Put the data from each of the fields into array variables or an array of a structure (there are at least a hundred ways to do this). Once you do that, simply create a subroutine to write the data to the report. The data will come from the array variables.

rmthomas20
Nov 12, 2009, 08:36 AM
A variable that is variable to every module in the program is a _______.

retsoksirhc
Nov 12, 2009, 09:40 AM
A variable that is variable to every module in the program is a _______.

It's called a "click this link: https://www.askmehelpdesk.com/finance-accounting/announcement-font-color-ff0000-u-b-read-first-expectations-homework-help-board-b-u-font.html "

Perito
Nov 12, 2009, 11:43 AM
A variable that is variable to every module in the program is a _______.

Try "Global Variable"