Hi i have an assignment to write a Shopping List program in which there can be any number of products entered along with the price. Im not really doing to well with it an would apprecite any help.
Heres my prgram so far
program ShoppingList (input,output); var numb:integer; prod:char; price:real; begin Repeat write('Please enter the number of products you wish to buy'); read(numb); until numb < 100; readln; for numb:= 1 to (numb) do begin write('Please Enter product'); read(prod); readln; write('Please Enter the Price'); read(price); readln; end; end.
This works but does not display the text in a good format and i am not able to add up the total cost of the items which would help. I was thinking of trying to display it like this
Shopping List Product Price ham £0.9 etc
By using write('Shopping List');
howvere i know this wont work and was jsut wondering if anyone has any ideas which could help me find the solution. Any help would be appreciated.
thanks in advance.