CSC148H1 Study Guide - Midterm Guide: Cash Register, Docstring, Init

52 views5 pages
25 Oct 2018
School
Course
Professor
katrinasavvy and 38715 others unlocked
CSC148H1 Full Course Notes
1
CSC148H1 Full Course Notes
Verified Note
1 document

Document Summary

Implement a class that models a cash register in a store. This cash register will know what the hst tax rate is (charged on all sales, for simplicity), is able to make sales, and keeps track of cash received as sales and tax. Your class implementation should include only the following (these are the only parts we will grade): a declaration of class name, and a class docstring. a method to make a sale for a given price and amount of cash paid by the customer, recording the money paid (including tax, which this method calculates), and returning the amount of change owed. a method to report the total number of sales made and the total cash received (including tax) an eq method to report whether the attributes of one cash register are equivalent to those of another cash register. All methods must have proper docstrings, except no examples are required. class cashregister: