
-----------------------------------
wenchman
Sun Nov 21, 2004 2:45 pm

Need Cash Register and Test Averageing Program Help
-----------------------------------
I've been doing homework handed out by my teacher for a while, and am stumped on two questions. I was wondering if anyone could just give me the answer, because no matter what I do, it's wrong.

1. Create a pgrogram which calculates teh average mark in a group of tests. Assume al tests are out of ten. Make the user enter the mark for each test in the group one at a time. When there are no more tests to input, enter the number "-1" and print out the average.
 a) Make sure users can only enter numbers 1-10
 b) Make it so the program can handle users entering no marks.

2. Create a program that will act as a simple cash register. It will accept the name of an item and the cost. The user will enter an item name "done" to signify that the customer is finished. The program will output a bill with the sub-total, PST, GST and total price.

  a) Make it so the user can only enter positive values.
  b) Display all items and their prices in the bill.

Any help on this will be greatly appreciated. I just can't seem to get these two last questions of my homework. :(


Here's one of mine, if it'll help, its my attempt to the first one:

var mark, average, subtotal :real:=0 
var count:int:=0
loop
    loop
    put "Type in a test mark between 1-10 and 45 to exit: "..
    get mark
    exit when mark >=0 and mark >>>>>>>>>>>>
tax:= cost*0.15
total:=cost+tax
put "Tax total is"," ",tax
put "And total is"," ",total
%>>>>>>>>>>>>>
loop
put"Enter amount of cahsgiven"
get cashgive
%>>>>>>>>>>>>>
if cashgive