Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Programming (https://www.askmehelpdesk.com/forumdisplay.php?f=437)
-   -   Qbasic programming player's stats (https://www.askmehelpdesk.com/showthread.php?t=414655)

  • Nov 10, 2009, 09:17 AM
    Simonne
    qbasic programming player's stats
    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
  • Nov 10, 2009, 09:25 AM
    Simonne

    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
  • Nov 10, 2009, 10:11 AM
    Perito

    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.
  • Nov 12, 2009, 08:36 AM
    rmthomas20
    A variable that is variable to every module in the program is a _______.
  • Nov 12, 2009, 09:40 AM
    retsoksirhc
    Quote:

    Originally Posted by rmthomas20 View Post
    A variable that is variable to every module in the program is a _______.

    It's called a "click this link: https://www.askmehelpdesk.com/financ...-b-u-font.html "
  • Nov 12, 2009, 11:43 AM
    Perito
    Quote:

    Originally Posted by rmthomas20 View Post
    A variable that is variable to every module in the program is a _______.

    Try "Global Variable"

  • All times are GMT -7. The time now is 06:11 AM.