0% found this document useful (0 votes)
44 views4 pages

Week-1 Teaching A Level Computer Science OOP Activities: Activity1

This document contains instructions for 4 activities related to teaching object-oriented programming concepts using a Pizza ordering system example. The activities have students: 1) Define attributes and methods for a Pizza class including a cost method. 2) Create objects for 2 customers and call methods to display order details and calculate costs. 3) Debug issues calculating costs for the second customer's order. 4) Expand the Pizza class by adding logic for toppings, delivery fees, and weekend price increases.

Uploaded by

colleeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views4 pages

Week-1 Teaching A Level Computer Science OOP Activities: Activity1

This document contains instructions for 4 activities related to teaching object-oriented programming concepts using a Pizza ordering system example. The activities have students: 1) Define attributes and methods for a Pizza class including a cost method. 2) Create objects for 2 customers and call methods to display order details and calculate costs. 3) Debug issues calculating costs for the second customer's order. 4) Expand the Pizza class by adding logic for toppings, delivery fees, and weekend price increases.

Uploaded by

colleeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Week-1 Teaching A level Computer Science OOP Activities

Activity1:
2. Explain why strings in Python could be considered as a
built-in object using an example.

3. For your Staff() class we would like staff address to be


included. Extend your original code to include this attribute.
4. Change the method greet() to staff_details and print
staff_details.
5. Create a method to calculate salary of staff by including
number of hours they worked times staff rate per hour which is
£30.
6. Add bonus £150 to staff who have worked more than 28 hours.
Bonus must be included in their salary.

1|Page
Activity 2:
1. Table below shows the costs for Pizza.
Pizza_Choice Small Medium Large
Cheese & £8.99 £10.99 £12.99
Tomato
Ham & £8.99 £10.99 £12.99
Mushroom
BBQ Chicken £8.99 £10.99 £12.99
Hawaiian £8.99 £10.99 £12.99
Pepperoni £8.99 £10.99 £12.99
Mexican £8.99 £10.99 £12.99
Chicken
Vegetarian £8.99 £10.99 £12.99
Vegetarian £8.99 £10.99 £12.99
Hot

Here is the start to our Pizza class, type this code and save it.

1. Give examples of attributes for class Pizza


…………………………………………………………………………………………………………………………………………………………………………
2. What is the purpose of pizza_cost=0.0 in the __init__ method ?

3. Now we are going to include customer2 object information


(“Scott”,”Vegetarian”,12) and call the method displayorder().
pizza_size is an int not a string datatype so do you think it
will print the customer2 information?
Your predicted result …………………………………………………………………………………….
Now run the program and compare whether it matches your result

Activity 3:

2|Page
Continuing on from activity 2 we have added a new method cost()

1) Complete typing the cost() method and calling customer1.cost()


and customer2.cost() before displayorder() method. Why do you think
cost() method is called before displayorder() method?

2) After completely typing the code run the program. Does your
program run properly if not what do you think is the problem? Debug
the code.

3) What do you think will be the total for customer2’s order? Do you
think it has been calculated correctly? If not give your reasons.

Activity 4:

3|Page
1. If a customer chooses “yes” for toppings then an additional cost
of £2.50 is included in total. Amend this information to Pizza
class.
2. Orders over the total cost of £12 are eligible for free delivery
but if not an addition £2.00 is added to the total cost.
3. On weekends Pizza prices are increased by 1.50 for pizza of all
sizes. Include this information when calculating total.

4|Page

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy