object oriented programming 5

Question 1

A tour agency needs to track the tours it has scheduled, the bookings made for them and the passengers that the bookings are for.

Question 2

You are given the class Product that has a code and quantity on hand, the relevant getter and setter methods and the string method

class Product:

def __init__(self, code, qtyOnHand):

self._code = code

self._qtyOnHand = qtyOnHand

@property

def code(self):

return self._code

@property

def qtyOnHand(self):

return self._qtyOnHand

@qtyOnHand.setter

def qtyOnHand(self, qtyOnHand):

self._qtyOnHand = qtyOnHand

def __str__(self):

return ‘Code: {:5s} Quantity: {:3d}’.format(self._code, self._qtyOnHand)


Question 3

Implement a simple graphical user interface (GUI) to simulate a cash register for a burger outlet which serves three types of burger. Burger Code

Name

Price

B

Beef Burger

12.95

C

Chicken Burger

5.95

F

Fish burger

7.95