讲解data留学生编程、c++,Python语言辅导、Java程序讲解 辅导Web开发|讲解留学生Processing
- 首页 >> Python编程 Lesson 1.4 Making Decisions
Major Assignment
Activity 1.4: Making a Pizza!
(Due on Sunday, February 28 at midnight)
Putrid Pizza is a pizzeria that only makes one type of pizza with the following toppings:
extra, extra anchovies and extra, extra olives.
Customers aren’t allowed to order any other type of pizza, but they are allowed to select
the size (by indicating the diameter).
Your task is to prompt the user for the diameter of pizza he or she would like to
purchase, and then calculate the subtotal, the taxes, and the grand total.
Your program should also output a message based on the following:
If the diameter of the pizza is from 1cm up to and including 20 centimeters, then
output a message that reads: “We are going to make you a cute little pizza!”
If the diameter of the pizza is greater than 20 cm up to and including 40 cm, then
output a message that reads: “This will be delicious!”
If the diameter of the pizza is greater than 40 cm, then output a message that
reads: “Whoa, big pizza! You might need a truck to get this home!”
The following lists the charges for a pizza at Putrid Pizza:
$0.75 per pizza (for labour)
$0.99 per pizza for rent (for the pizza shop)
$0.50 per diameter centimeter of pizza (for ingredients)
You will submit your completed program (project), as well as a flowchart that outlines
the start, end, processes, input/output and decisions involved in the program.
Your program should include:
a well-designed GUI that uses a form, textboxes, labels and a button.
appropriately named components.
commenting and appropriate spacing.
values that are rounded and formatted to two decimal places.
constants for all variables that will not change as the program is run.
The following is a screen capture of a sample GUI created for this program:
1
2
Checklist:
2 Flowchart
1 Input display correctly chosen i.e. GUI
1 Comments and spacing
1 Rounded to 2 decimal places
1 Constants with CAPITALS
2 if, else if … correct for 3 sizes
1 Output display correctly chosen i.e. setText()
1 Compiles and runs error-free
3
Major Assignment
Activity 1.4: Making a Pizza!
(Due on Sunday, February 28 at midnight)
Putrid Pizza is a pizzeria that only makes one type of pizza with the following toppings:
extra, extra anchovies and extra, extra olives.
Customers aren’t allowed to order any other type of pizza, but they are allowed to select
the size (by indicating the diameter).
Your task is to prompt the user for the diameter of pizza he or she would like to
purchase, and then calculate the subtotal, the taxes, and the grand total.
Your program should also output a message based on the following:
If the diameter of the pizza is from 1cm up to and including 20 centimeters, then
output a message that reads: “We are going to make you a cute little pizza!”
If the diameter of the pizza is greater than 20 cm up to and including 40 cm, then
output a message that reads: “This will be delicious!”
If the diameter of the pizza is greater than 40 cm, then output a message that
reads: “Whoa, big pizza! You might need a truck to get this home!”
The following lists the charges for a pizza at Putrid Pizza:
$0.75 per pizza (for labour)
$0.99 per pizza for rent (for the pizza shop)
$0.50 per diameter centimeter of pizza (for ingredients)
You will submit your completed program (project), as well as a flowchart that outlines
the start, end, processes, input/output and decisions involved in the program.
Your program should include:
a well-designed GUI that uses a form, textboxes, labels and a button.
appropriately named components.
commenting and appropriate spacing.
values that are rounded and formatted to two decimal places.
constants for all variables that will not change as the program is run.
The following is a screen capture of a sample GUI created for this program:
1
2
Checklist:
2 Flowchart
1 Input display correctly chosen i.e. GUI
1 Comments and spacing
1 Rounded to 2 decimal places
1 Constants with CAPITALS
2 if, else if … correct for 3 sizes
1 Output display correctly chosen i.e. setText()
1 Compiles and runs error-free
3