
-----------------------------------
- IzAk -
Tue Jun 06, 2006 11:05 am

Cash Register
-----------------------------------
var gst, pst, cost, total, cash, grat : real
put "=============================================="
put "| Welcome to J's Cash Register Program!  |"
put "=============================================="
put "Please enter the amount of your item: " ..
get cost
put "=============================================="
gst := cost * .08
pst := cost * .07
grat := cost * .17
put "Gst: $", gst
put "Pst: $", pst
put "Grat: $", grat
put "Tax Total: $", gst + pst
total := cost + gst + pst + grat
put "Grand Total is: $", total
put "=============================================="
put "Please enter your amount of cash: $" ..
get cash
cash := total - cash
put "=============================================="
total := cost + gst + pst + grat
cash := total - cash
if total >= cash then
    put "Not enough money get moving: $", cash - total
elsif cash >= total then
    put "Your change is: $", cash - total
end if
put "=============================================="
put "Thanks for using J's Cash Register Program"
put "=============================================="


-----------------------------------
jamonathin
Tue Jun 06, 2006 4:44 pm


-----------------------------------
I would never return to your store.  A tip (gratuity) is what you feel the person deserves, not what is required.

-----------------------------------
Clayton
Tue Jun 06, 2006 4:57 pm


-----------------------------------
hm read the stickies in each forum, at the top of the forum here it clearly states that these kinds of programs arent needed to be posted (that is to say ones that are programmed in no more than 5 minutes)

-----------------------------------
Remm
Tue Jun 06, 2006 6:18 pm


-----------------------------------
Agreed. These programs are made in bulk throughout the schoolyear for assesment, i have a good 15 or so. Go more creative and out-of-the-curiculum.

Meh. Nice regester tho. I have one I did for marks and its horrible in comparrison. lol. teacher didint like that she couldnt tell what variables did what (i had one named cheese, ect...)

-----------------------------------
- IzAk -
Wed Jun 07, 2006 12:21 pm


-----------------------------------
man im glad oner person had something decent to say

-----------------------------------
BlackDragon989
Wed Jun 14, 2006 1:17 pm


-----------------------------------
wow your store is poor if they gotta use turnin to get totals..... lmao jk jk sick... its better than mine, mine was like 50+ lines.. lmao

-----------------------------------
rownale
Wed Jun 14, 2006 4:42 pm


-----------------------------------
Nice looking but I dont think it works properly
If you enter $1 for the item it says ur tax is 15 cents but ur grand total becomes 1.32...

total := cost + gst + pst + grat

should become

total := cost + gst + pst


-----------------------------------
_justin_
Wed Jun 14, 2006 4:48 pm


-----------------------------------
accutly the assigenmt said we had to add .17 tip so thats why it comes out greater then what the total should be

-----------------------------------
BenLi
Wed Jun 14, 2006 8:15 pm


-----------------------------------
pretty good, you can try first asking for how many itmes they have and using that value for a for loop. That way you can calculate multiple items

-----------------------------------
- IzAk -
Thu Jun 15, 2006 12:28 pm


-----------------------------------
never thought of that, thnx...

-----------------------------------
- IzAk -
Thu Jun 15, 2006 1:26 pm


-----------------------------------
wanna give me some tips on how to do that...

-----------------------------------
Clayton
Thu Jun 15, 2006 2:46 pm


-----------------------------------
put a loop around the whole thing, clear the screen at the top of the program, and initialize the variables back to default values at the start of the loop

-----------------------------------
- IzAk -
Thu Jun 15, 2006 7:06 pm


-----------------------------------
thnx, i'll take that as an option... again thnx for the support.

-----------------------------------
BenLi
Thu Jun 15, 2006 9:46 pm


-----------------------------------
it'll look something like this


var n, cost, subtotal, total : int := 0

put "how many items?"
get n
for i : 1 .. n
    put "How much item ", i, " cost?"
    get cost
    subtotal += cost
end for
put "subtotal is ",subtotal
put "gst is ", subtotal * .08
put "pst is ", subtotal * .07
put "total is ", subtotal * 1.15

srry if code is non-working
i don't having turing on this comp

-----------------------------------

Mon Jun 19, 2006 11:24 am


-----------------------------------
There's nothing wrong with his program. The GUI is frendly, and it look's all nice. + bits

-----------------------------------
- IzAk -
Mon Jun 19, 2006 12:43 pm


-----------------------------------
thnx man

-----------------------------------
aldreneo
Mon Jun 19, 2006 1:38 pm


-----------------------------------
Works great!

I am making a nice mod of this which allows you to print receipts

Oh, and soon pst will be 6% so I changed that
