Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Function 2, pizza: Whether a pizza you ordered for delivery is hot depends on the size of the pizza and the number of pizzas ahead

Function 2, pizza: Whether a pizza you ordered for delivery is hot depends on the size of the pizza and the number of pizzas ahead of you when you order. If you order a large pizza, and 5 or fewer pizzas are ordered ahead of you, then the pizza will be delivered hot. If you order a small pizza, and 2 or fewer pizzas are ordered ahead of you, then your pizza will be delivered hot. Write a function pizza USING PROCESSING that accepts the size of the pizza which is the character s for small or the character l for large. The function also accepts the number of pizzas in front of you in the pizza making line. The function returns 0 for cold or 1 for hot.

Test Function 2, pizza: Write a function to test your pizza function. Include all the appropriate test cases for different types of output. You will lose points for missing important test cases. Your test function should give each test a name, e.g. Test 1, Test 2, etc. The test function should print the name of the test and whether the test succeeded or failed.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions