Advertisement
IBeetle

Fileopener

Jan 7th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. var fileno, invoice, tickets : int
  2. var events, person : string
  3. var total, price, total2, service, servicetot : real
  4. service := 1.50
  5. View.Set ("graphics:1024,768")
  6. open : fileno, "events.txt", get
  7.  
  8. get : fileno, person
  9. get : fileno, invoice
  10.  
  11. put "Customer: ", person
  12. put "Customer Number: ", invoice
  13. %Bottom
  14. put " "
  15. put " "
  16. put "Event" : 50, "Price" : 10, "Nr. of Tickets" : 20, "Event Total"
  17. put " "
  18. total2 := 0
  19. servicetot := 0
  20. loop
  21. exit when eof (fileno)
  22. get : fileno, events : *
  23. get : fileno, price
  24. get : fileno, tickets
  25. total := (price * tickets) + service * tickets
  26. total2 := total2 + total
  27. servicetot := servicetot + (service * tickets)
  28.  
  29. put events : 50, price : 5, tickets : 12, total : 18 : 2
  30.  
  31.  
  32. end loop
  33. put ""
  34. put " " : 28, "Total of all events" : 50, " ", total2 : 3 : 2
  35. put " " : 28, "Service Charge" : 52, servicetot : 3 : 2
  36. put " " : 28, "Final Total" : 51, total2 + servicetot : 3 : 2
  37. close (fileno)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement