Okay, this program is designed to withdraw information from a .txt file that contains a list of grocery items. After the item number is used, then the item number will be withdrawn and you will have to input how many of the item there is. What I am having a problem with is that when I run it, it works fine to a point, but if I put an invalid number before a valid number, then the items after that invalid number continue to state that its invalid, even if it is valid. I am not sure how to change or make it work anymore and am requesting help. Besides that, it works, and also curious of how to use set precision correctly to space everything out.
Thank you.
//This program is designed to ask for a unit item, if taxed with calculate the tax and withdraw the item from 'item.txt'
//to a program called 'mark.txt'
//Mark
//Homework Assignment #3
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
using namespace std;
the way you wrote the prog is verey confusing try to make your prog more structured
you can use for the end of file
1 2
while (inputData)//will repeat the loop until the end of the file
//then read the codes
also u can use the do while loop insted of writing inputdata.seekg(0);
and about the setprecision we use it to determain how many digits we want for float
values
if u want to controll the spaces u can use setw()
all this u can find them in the refernce of this site