Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Challenge 2 : Can we program it ? Knightro saw how hard you ended up working today. It is crazy that you were able to

Challenge 2: Can we program it?
Knightro saw how hard you ended up working today. It is crazy that you were able to do all that by hand! Knightro heard you were taking a computer science class and thought that you might be able to help him with the software he was using. He has noticed there are a few bugs and some lines that are missing. He has asked you to help him fix his code.
Here are the procedures from the previous challenge.
Meals are $12.50 unless you are a student, and then it is $8.95
For groups of 8 people or more, we no longer look at how many students are a part of the group. We just charge everyone $10.25.
Pizza takes a while to cook. But the good thing is we can cook them at the same time. The oven stores one and a half pizzas at a time, and we can feed the oven (think conveyor belt) constantly. If we cook one pizza, it will take 10 minutes, and each pizza after the first takes 5 minutes more. So if we cook 4 pizzas, it would be 25 minutes.
We want at least 50 forks available to guests. If the number of forks falls below 50, we will add 100 forks to the holder.
Flag question: Question 1
Question 12 pts
Knightro wants you to focus on the total cost people will pay when they come in. He already stores the number of non-students in a variable called people and students called students.
Write a single line of code that will store the total price the group will pay and store the result in the variable, total.
HINT: Make sure you leave the trailing zero in the price of the meal in your answer.
Flag question: Question 2
Question 22 pts
Since Knightro is storing the number of non-students and students in variables: people and students. Write an if statement that will determine if the group is large enough for a group discount.
Flag question: Question 3
Question 32 pts
Knightro assumes that the variable pizzas will be 1 or greater. He wants to write a line of code that will determine the total time it will take cook. Store the result as total_time.
Flag question: Question 4
Question 44 pts
Knightro has written a variable called forks. It stores the number of forks in the holder. Write two lines to determine if we need to add forks, then add the forks to the holder.
Line 1:
Line2:

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

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions