02-19-2006, 12:41 PM
Hi all, i'm new here, i need help in making a table of payment for a store... The problem's like this :
A store sells 8 items, A,B,C,D,E,F,G,H and each has its own price.
Now whenever you run the program, it'd show the list of the items and the price (no problem here), and then you'll be asked :
The number of the appearance of these statements depends on the first input, which is 3, so if i enter 6, it'd show :
How do i do this? One more thing, there can't be 2 of the same item, so if i've selected A on the first selection, i can't select it again, BUT i don't want it to redo from the start (error message) maybe it'd better if it looks like this :
And also, when the item doesn't exist, it'd show :
Any idea how to do this?
And lastly after the selection is done, i plan to make the table which shows the list of the item + their price and the total price, i don't have any problems in drawing tables, but i don't know how to make the row extended based on the number of items... so if i entered 3 on the first input, there'd be 4 rows (1 for name/price,etc) and if i entered 6, there'd be 7.
Thanks in advance and sorry if i ask too much...
A store sells 8 items, A,B,C,D,E,F,G,H and each has its own price.
Now whenever you run the program, it'd show the list of the items and the price (no problem here), and then you'll be asked :
Code:
Enter amount of items to buy : 3
Enter 1st item : C
Enter 2nd item : B
Enter 3rd item : D
Code:
Enter 1st item : C
Enter 2nd item : B
Enter 3rd item : D
Enter 4th item : H
Enter 5th item : A
Enter 6th item : F
Code:
Enter 1st item : A
Enter 2nd item : A
Item already chosen, please choose the other
Enter 2nd item :
And also, when the item doesn't exist, it'd show :
Code:
Enter 1st item : A
Enter 2nd item : Y
Item does not exist, please choose the available items
Enter 2nd item :
Any idea how to do this?
And lastly after the selection is done, i plan to make the table which shows the list of the item + their price and the total price, i don't have any problems in drawing tables, but i don't know how to make the row extended based on the number of items... so if i entered 3 on the first input, there'd be 4 rows (1 for name/price,etc) and if i entered 6, there'd be 7.
Thanks in advance and sorry if i ask too much...