answer.
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
Setler [38]
3 years ago
11

Bianca is preparing special dishes for her daughter’s birthday. It takes her a minutes to prepare the first dish, and each follo

wing dish takes b minutes longer than the previous dish. She has t minutes to prepare the dishes. For example, if the first dish takes a = 10 minutes and b = 5, then the second dish will take 15 minutes, the third dish will take 20 minutes, and so on. If she has 80 minutes to prepare the dishes, then she can prepare four dishes because 10 + 15 + 20 + 25 = 70. Write a program that prompts the user to enter the values of a, b, and t, and outputs the number of dishes Bianca can prepare.
Computers and Technology
1 answer:
blagie [28]3 years ago
4 0

Answer:

The solution code is written in Python:

  1. a = int(input("Input first dish time: "))
  2. b = int(input("Input extra minutes: "))
  3. t = int(input("Input time available: "))
  4. dishesCount = 1  
  5. currentTotal = a + b
  6. while(currentTotal <= t):
  7.    dishesCount += 1
  8.    currentTotal += currentTotal + b
  9. print("Number of dishes can be prepared: " + str(dishesCount))

Explanation:

Firstly, prompt user to input the first dish time, extra minutes and time available and assign the values to variable a, b and t, respectively (Line 1-3).

Next, create variable dishesCount to hold the number of dishes can be prepared (Line 5).

Get the current total time by adding a and b and assign it to variable currentTotal (Line 6).

While the currentTotal is less than or equal to t, increment the dishesCount by one and then add the hour of current dish to the currentTotal (Line 9-10).

At last, display the number of dishes that can be prepared in t minutes (Line 12).

You might be interested in
A colleague sent you an awesome article about using proper ergonomics while sitting at the computer. You don't have time to read
lys-0071 [83]

Answer: Select the article attachment and save it to your computer.

Explanation:

5 0
2 years ago
A search box does all of the following EXCEPT ________.
Rudik [331]
The answer is the first one
6 0
2 years ago
Read 2 more answers
Explain why E-mail A is inappropriate for the workplace and revise it to be appropriate.
cluponka [151]

Answer:

its not there mate

Explanation:

4 0
2 years ago
Read 2 more answers
Which of the following statements is true? Using existing exceptions makes the program less robust. Always create your own excep
hjlf

Answer:

The third option is correct.

Explanation:

The following option is true because it's a derived with that Throwable class. More than that exception type, it is also other category called Error originating through that Throwable class. As any other class, the exception class will also include fields as well as functions. So, the following are the reason that describes the following answer is true according to the exception class.

The other options are not appropriate according to the following scenario.

8 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
kvasek [131]

Answer:

Presentations?

Explanation:

6 0
2 years ago
Other questions:
  • The part of the computer that contains the brain, or central processing unit, is also known as the A.monitor B.modem C.keyboard
    10·1 answer
  • Currently, there are two major techniques used to develop programs and their procedures. name and describe them. html editor key
    11·1 answer
  • Exercise 6.3 consider memory storage of a 32-bit word stored at memory word 42 in a byte-addressable memory. (a) what is the byt
    14·1 answer
  • Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the water. If we neglect air resistance, then t
    12·1 answer
  • A class of Students was previously defined with the following properties: a string name, an integer age, a Boolean variable indi
    14·1 answer
  • A technician is troubleshooting a small network with cable Internet service in which a user is receiving a message in her web br
    15·1 answer
  • What are some reasons DNS is necessary? Check all that apply. A. It maps local addresses to simple names without editing hosts f
    7·1 answer
  • (choose one) Which is the proper means to decrement the integer variable, myScore, by one?
    15·1 answer
  • What are ways to enter a formula in Excel? Check all that apply. Click on the Function Library group and select a function from
    10·2 answers
  • Draw a flowchart and write the algorithm to find even number between 1 to 50​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!