联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2021-02-28 06:27

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


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp