well, the data in the txt file is comma delimited, so the only way I knew how to extract it and put it into a vector was with a string. My program is actually working correctly if there are no single digit numbers now. However the second I change it so that some of the data has single digits, it screws up and gives the highest salary as the highest single digit number.
edit here is my code updated so far:
output :
Please select 1, 2, 3, or 4:
1. Search salary
2. Generate stats file
3. Print salaries
4. Quit program
2
Salary Data (in dollars):
$07 $01 $13 $50 $37 $06
highest:07
lowest:07
highest:07
lowest:01
highest:13
lowest:01
highest:50
lowest:01
highest:50
lowest:01
highest:50
lowest:01
The stats.txt file has been generated.
The highest and the smallest salaries are: $50 and $01
Please select 1, 2, 3, or 4:
1. Search salary
2. Generate stats file
3. Print salaries
4. Quit program
HOWEVER, if I change the data file that goes into the vector I get this:
Please select 1, 2, 3, or 4:
1. Search salary
2. Generate stats file
3. Print salaries
4. Quit program
2
Salary Data (in dollars):
$7 $1 $13 $50 $37 $6
highest:7
lowest:7
highest:7
lowest:1
highest:7
lowest:1
highest:7
lowest:1
highest:7
lowest:1
highest:7
lowest:1
The stats.txt file has been generated.
The highest and the smallest salaries are: $7 and $1
Please select 1, 2, 3, or 4:
1. Search salary
2. Generate stats file
3. Print salaries
4. Quit program