I have to write a program which reads a file that is this list:
Bread
2.49
Y
Milk
1.89
N
Eggs, dozen
0.97
N
Apples
4.75
Y
Bananas
1.69
Y
Peanut Butter
2.49
Y
It has to print a receipt and be able to work if items are added to the list. When I run my program it looks perfect, except it is not reading the first character of the item names.
Using getline on the first item separately, before the while loop. This only fixed the problem for the first item.
Using different conditions for the while loop such as:
while (inFile >> name >> price >> taxable)
while (inFIle >> name)
while (inFIle >> price)
while (!inFile.eof())
Using various ignore statements in different positions within the while loop. These only added to the problem because then it would ignore even more characters in the name.