2013-09-24, 01:14 AM
All right, so this is what I have so far. It's late and I haven't added this to the actual flowchart yet. Note that the flowchart isn't part of the assignment, I'm just doing it so I know what the hell I'm doing. e_e Good practices and all that.
1. Read names of input and output files.
2. Open input file. Terminate program if file not opened.
3. Open output file.
4. Read indicator+number and move position accordingly (switch #1).
5. Read indicator+number and move position accordingly (switch #2).
6. Read word.
7. Place word in position.
8. Repeat steps 4-7 until the file ends.
9. Print result on screen (with bars).
10. Print same result on output file (without bars).
Notes:
- While loop for input file reading only, so only one is needed.
- Inside the while loop, use switches for the indicators and numbers. These will be separate functions.
- At least two switches: One for line number, one for word number.
- Structs come in after it is determined where a word goes, in the form of name.Line#.word# = ""; (since these structs are nested). Use this in the switches??
Any feedback is appreciated. I'm somewhat skeptical on it since I'm not sure if this accounts for the fact that the line number and word number isn't always going to be in that same order (+1-2 or -2+1 for example). Never used structs or switches before!
1. Read names of input and output files.
2. Open input file. Terminate program if file not opened.
3. Open output file.
4. Read indicator+number and move position accordingly (switch #1).
5. Read indicator+number and move position accordingly (switch #2).
6. Read word.
7. Place word in position.
8. Repeat steps 4-7 until the file ends.
9. Print result on screen (with bars).
10. Print same result on output file (without bars).
Notes:
- While loop for input file reading only, so only one is needed.
- Inside the while loop, use switches for the indicators and numbers. These will be separate functions.
- At least two switches: One for line number, one for word number.
- Structs come in after it is determined where a word goes, in the form of name.Line#.word# = ""; (since these structs are nested). Use this in the switches??
Any feedback is appreciated. I'm somewhat skeptical on it since I'm not sure if this accounts for the fact that the line number and word number isn't always going to be in that same order (+1-2 or -2+1 for example). Never used structs or switches before!

