This program is about Mail order. the user will input an item number, the valid item number is shown as guide for the users. the program will ask about the item number and the quantity. then that data is going to be in the text file.
Example:
Enter item number: 101 --> the user inputs a valid item number proceeds to the quantity
Enter quantity for this item: 6 --> wants 6 in item number 101
Enter another item? yes or no : yes --> i set this in a looping structure.
after the user inputs yes then it goes back to the first question.
each item number has a different price. these price will not be shown in the command prompt.
the item number and quantity and the price are sent to a text file and i successfully put the data there. (no problems with that. even if the user inputs many times the data in the text file will be put into the second line in the text file.)
Now, here is what i really need help.
if the user inputs many item number and with each are different prices and quantities. the last data to put it on it is the total price. if the given example item number 101 has a price of 49.99 (double data type) and its quantity is 6 so i should multiply it. the variable name set to store the total price is tPrice and i wish to put it in the text file but when i compile it, it goes on an error, saying --> cannot find symbol method write(double).
i wrote it like this:
double tPrice = price * quan;
wtr.write(tPrice);
wtr.close();
(note: wtr is the name of my filewriter.)
any help would be appreciated.
thank you.
Example:
Enter item number: 101 --> the user inputs a valid item number proceeds to the quantity
Enter quantity for this item: 6 --> wants 6 in item number 101
Enter another item? yes or no : yes --> i set this in a looping structure.
after the user inputs yes then it goes back to the first question.
each item number has a different price. these price will not be shown in the command prompt.
the item number and quantity and the price are sent to a text file and i successfully put the data there. (no problems with that. even if the user inputs many times the data in the text file will be put into the second line in the text file.)
Now, here is what i really need help.
if the user inputs many item number and with each are different prices and quantities. the last data to put it on it is the total price. if the given example item number 101 has a price of 49.99 (double data type) and its quantity is 6 so i should multiply it. the variable name set to store the total price is tPrice and i wish to put it in the text file but when i compile it, it goes on an error, saying --> cannot find symbol method write(double).
i wrote it like this:
double tPrice = price * quan;
wtr.write(tPrice);
wtr.close();
(note: wtr is the name of my filewriter.)
any help would be appreciated.
thank you.