| | |
Quick pseudocode question for anyone who might be able to help...
Thread Solved
![]() |
I am going through and rechecking my work on a project and was hoping someone might see if I am on the right track. First off the project is as stated:
A baseball team manager wants a report showing her players' batting statistics. A batting average is computed as hits divided by at-bats, and it is usually expressed to three decimal positions (for example, .235). The output consists of a printed report titled TEAM STATISTICS. Fields printed on output are: player number, first name, last name, and batting average. The input file description is shown below:
File name: BASEBALL
FIELD DESCRIPTION DATA TYPE COMMENTS
Player Number Numeric 2 digits, 0 decimals
First Name Character 16 characters
Last Name Character 17 characters
At-bats Numeric never more than 999, 0 decimals
Hits Numeric never more than 999, 0 decimals
In my print chart (using the output fields given to me) I used X’s as the place holder for char variables and 9’s for num variables. Was I correct in my usage of these?
When writing my pseudocode I declare my variables in a module called housekeeping(). We are currently working on reading input from a file or files rather than asking the user directly for input. I am a bit confused how this might work with my pseudocode though. I know how I might write it out but am unsure of the file I am pointing to. In this project I would need to point to the file which contains the player’s number, name, etc.. The print chart is an output file so it would not come from there. Where and how might I include the fictitious input needed for the program to run?
Lastly, when declaring your variables and including a column header with defined character spaces, do you space according to that? For example:
inputFileName
num playerNumber
char firstName
char lastName
num atBats
num hits
char mainHeading = “TEAM STATISTICS”
char columnHead = “PLAYER NUMBER FIRST NAME LAST NAME BATTING AVERAGE”
In the line above would you space twice after player number and 16 spaces after first name because that is how many char spaces are allotted? Or is it just spacing enough between the headings to allow everything to fit and look nicely?
Thanks for every ones input!
A baseball team manager wants a report showing her players' batting statistics. A batting average is computed as hits divided by at-bats, and it is usually expressed to three decimal positions (for example, .235). The output consists of a printed report titled TEAM STATISTICS. Fields printed on output are: player number, first name, last name, and batting average. The input file description is shown below:
File name: BASEBALL
FIELD DESCRIPTION DATA TYPE COMMENTS
Player Number Numeric 2 digits, 0 decimals
First Name Character 16 characters
Last Name Character 17 characters
At-bats Numeric never more than 999, 0 decimals
Hits Numeric never more than 999, 0 decimals
In my print chart (using the output fields given to me) I used X’s as the place holder for char variables and 9’s for num variables. Was I correct in my usage of these?
When writing my pseudocode I declare my variables in a module called housekeeping(). We are currently working on reading input from a file or files rather than asking the user directly for input. I am a bit confused how this might work with my pseudocode though. I know how I might write it out but am unsure of the file I am pointing to. In this project I would need to point to the file which contains the player’s number, name, etc.. The print chart is an output file so it would not come from there. Where and how might I include the fictitious input needed for the program to run?
Lastly, when declaring your variables and including a column header with defined character spaces, do you space according to that? For example:
inputFileName
num playerNumber
char firstName
char lastName
num atBats
num hits
char mainHeading = “TEAM STATISTICS”
char columnHead = “PLAYER NUMBER FIRST NAME LAST NAME BATTING AVERAGE”
In the line above would you space twice after player number and 16 spaces after first name because that is how many char spaces are allotted? Or is it just spacing enough between the headings to allow everything to fit and look nicely?
Thanks for every ones input!
•
•
•
•
When writing my pseudocode I declare my variables in a module called housekeeping(). We are currently working on reading input from a file or files rather than asking the user directly for input. I am a bit confused how this might work with my pseudocode though. I know how I might write it out but am unsure of the file I am pointing to. In this project I would need to point to the file which contains the player’s number, name, etc.. The print chart is an output file so it would not come from there. Where and how might I include the fictitious input needed for the program to run?
Open input file X. Read from X Open output file Y. Write to Y
•
•
•
•
char columnHead = “PLAYER NUMBER FIRST NAME LAST NAME BATTING AVERAGE”
In the line above would you space twice after player number and 16 spaces after first name because that is how many char spaces are allotted? Or is it just spacing enough between the headings to allow everything to fit and look nicely?
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
![]() |
Similar Threads
- Reformating/reinstalling windows (Windows NT / 2000 / XP)
- Quick Question: Is J# the same thing as Java? (Java)
- Quick RAM Question - DIMM. (Motherboards, CPUs and RAM)
- Quick HijackThis question (Viruses, Spyware and other Nasties)
- quick sort question (C)
- perl for win98 were do i start (Perl)
- Any Sony Vaio owners? (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Help me please (C++)
Other Threads in the C++ Forum
- Previous Thread: Help with finding a good use for a hash table in my program....
- Next Thread: Parent / child class problems
| Thread Tools | Search this Thread |
action api array auto based beginner binary bitmap c++ c/c++ calculator challenge char class classes code coding compile console conversion count createcopyofanyfileinc delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game garbage givemetehcodez graph gui hmenu homeworkhelp homeworkhelper iamthwee ifstream input insert int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node noob output parameter pointer primenumbersinrange problem program programming project python random read recursion reference rpg sockets string strings temperature template test text text-file tree url variable vector video win32 windows winsock wordfrequency wxwidgets






