Yes, the input file is as follows:
Code:1 9999
1 5
1 50
5.00 900.00
6.00 1000.00
The code for this section originally looked like this:
The assignment calls for having an external file provide the validation range numbers.Code:prodNum = getint(1,9999,"Product Number");
prodType = getint(1,5,"Product Type");
getstring(desc);
prodQuant = getint(1,50,"Product Quantity");
prodCost = getreal(5.00,900.00,"Product Cost");
prodPrice = getreal(6.00,1000.00,"Product Price");
So, the code is now:
If you'd like, I can submit the code prior to this assignment so you can compile it and see how it works.Code:while (fscanf(fp, "%lf%lf", &min, &max) != EOF)
/* These use the getint() function because they are int's */
prodNum = getint(min,max,"Product Number");
prodType = getint(min,max,"Product Type");
getstring(desc);
prodQuant = getint(min,max,"Product Quantity");
/* These use the getreal() function because they are doubles */
prodCost = getreal(min,max,"Product Cost");
prodPrice = getreal(min,max,"Product Price");
fclose(fp);
This assignment only calls for changing the add(), getint(), and getreal() functions.
And, thank you so much for your patience and help.