1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ksivusya [100]
3 years ago
7

Write the Python code to implement each step of the following algorithm. Your code should use descriptive variable names and per

form all of the calculations necessary using the variables you define. You should not manually perform any calculation.
Computers and Technology
1 answer:
Lina20 [59]3 years ago
6 0

Answer:

# the number of pizza is initialised

# to 5

number_of_pizza = 5

# number of slice in each pizza

# is initialised to 8

slice_in_each_pizza = 8

# total number of pizza is calculated

total_number_of_slices = number_of_pizza * slice_in_each_pizza

# number of guest who respond yes

# is initialised to 10

number_of_guest_respond_yes = 10

# additional 3 guest is added to existing guest

number_of_guest_respond_yes += 3

# number of left over slice is gotten by using modulo arithmetic

number_of_left_over_slice = total_number_of_slices % number_of_guest_respond_yes

# the number of left over slice

# is printed which is 1

print(number_of_left_over_slice)

Explanation:

Missing Question Part: Use a variable to store the number of pizzas ordered as 5.

Assuming there are 8 slices in each pizza, use a variable to store the total number of slices calculated using the number of pizzas ordered.

Use another variable to store the number of guests who had responded YES as 10.

Three more people responded YES. Update the corresponding variable using an appropriate expression.

Based on the guest count, set up an expression to determine the number of left-over slices if the slices would be evenly distributed among the guests. Store the result of the expression in a variable.

The program is written in Python and it is well commented.

You might be interested in
When the binary code is retrieved from ram and moved to the cpu, this stage is known as
vaieri [72.5K]

This stage is known as fetching.

  • Any operation you do in a computer, it runs a lot of codes inside it, and these codes are in binary.
  • For the operation, the computer accesses the RAM memory to gather information about this process, and moves it to the CPU, in a process named as fetching.
  • Thus, the stage asked in this problem is known as fetching.

A similar problem is given at brainly.com/question/21536104

4 0
2 years ago
Teenagers and their parents will never understand each other-the generation gap is too big. Its for my grade 11 English speech​
bazaltina [42]

Answer:

lol

Explanation:

lol

7 0
2 years ago
Read 2 more answers
What typically happens by default when a file is double clicked in Microsoft Windows?
Ket [755]
<span>When a file is double clicked in Microsoft Windows typically the file opens or executes.</span>
For many people the<span> time in which they have to do two quick clicks of the left mouse button is too short. </span>
There is an option to adjust<span> the </span>double-click speed.<span> This can be done on the Buttons tab, under </span>Double-click speed.
3 0
3 years ago
In which scenario would instant messaging be more useful than other forms of communication?
ivann1987 [24]
When you're busy doing things and/or be too sick for over the phone communication
7 0
3 years ago
The function below takes two numeric parameters. The first parameter specifies the number of hours a person worked and the secon
Triss [41]

Answer:

def calculate_pay(total_worked_hours, rate_per_hour):

   if total_worked_hours > 40:

       return (40 * rate_per_hour) + ((total_worked_hours - 40) * 2 * rate_per_hour)

   else:

       return total_worked_hours * rate_per_hour

Explanation:

  • Create the calculate_pay function that takes 2 parameters.
  • Inside the function check whether the total_worked_hours is greater than 40 and then return the pay by calculating with the help of formula for work over 40 hours.
  • Otherwise return the pay by multiplying the total_worked_hours with rate_per_hour.
6 0
3 years ago
Other questions:
  • Achieving a degree in computer forensics, information technology, or even information systems can provide a strong foundation in
    11·1 answer
  • The memory allocated for a float value is ____ bytes.
    9·1 answer
  • Informs the network interface card to pass packets sent to that address to the ip stack so their contents can be read, and tells
    9·1 answer
  • What is the definition of a WAP?
    6·2 answers
  • The Internet may best be compared to a/an
    8·1 answer
  • How is it possible to find encyclopedias and reference texts on the internet
    11·2 answers
  • What is the difference between the Internet and the World Wide Web? Explain in your own words.
    13·2 answers
  • Write is an I.P.O cycle? Describe with figure​
    5·1 answer
  • In the table below, identify the data type that would be most suitable for the second field.
    10·2 answers
  • A video game controller contains the buttons: A, B, X, Y. When the player presses A their character Jumps. When the player press
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!