Hmmm.. i think i'll just explain it in details...
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: Select all
Enter amount of items to buy : 3
Enter 1st item : C
Enter 2nd item : B
Enter 3rd item : D
The number of the appearance of these statements depends on the first input, which is 3, so if i enter 6, it'd show :
Code: Select all
Enter 1st item : C
Enter 2nd item : B
Enter 3rd item : D
Enter 4th item : H
Enter 5th item :A
Enter 6th item : F
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 :
Code: Select all
Enter 1st item : A
Enter 2nd item : A
Item already chosen, please choose the other
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.
Sorry if i ask too much...