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
Ray Of Light [21]
3 years ago
12

4.15 LAB: Mad Lib - loops Mad Libs are activities that have a person provide various words, which are then used to complete a sh

ort story in unexpected (and hopefully funny) ways. Write a program that takes a string and integer as input, and outputs a sentence using those items as below. You may assume that the string does not contain spaces.The program repeats until the input is quit 0. Ex: If the input is: apples 5 shoes 2 quit 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away. Note: This is a lab from a previous chapter that now requires the use of a loop. LAB ACTIVITY 4.15.1: LAB: Mad Lib - loops 0 / 10
Computers and Technology
1 answer:
Sergio039 [100]3 years ago
7 0

Answer:

Following are the program in the Python Programming Language.

#set the infinite while loop

while(True):

 #get string input from the user

 name=input()

 #get integer input from the user

 num=int(input())

 #set the if statement to break the loop

 if(num==0):

   break

 #otherwise, print the following output

 else:

   print("Eating {} {} a day keeps the doctor away.".format(num, name))

<u>Output</u>:

oranges

5

Eating 5 oranges a day keeps the doctor away.

apple

0

Explanation:

<u>Following are the description of the program</u>:

  • Set the loop that iterates at infinite times and inside the loop.
  • Declare two variables which are 'name' that get string type input from the user and 'num' that get integer type input from the user.
  • Set the if conditional statement for break the infinite while loop.
  • Otherwise, it prints the following output.
You might be interested in
What does it mean to design,<br> implement, and maintain computer<br> systems?
docker41 [41]

Answer:

Let's take an example of the embedded system, which is a perfect example of this question as a computer system. Suppose we want the embedded system to record the details related to soil of agricultural land. We will take an IoT device which will be a sensor that can register soil properties, and get connected to the computer system through the internet. And we design an embedded system that registers these values and then copy them like somewhere in DB space on Amazon cloud or Google cloud. And finally display on some LCD or a big projector, or whatever, and like we design. Thus we have designed, and now when we install this on agriculture land, we implement it, and since check regular for correct performance, we maintain this embedded or a mini-computer system as well. This is what design, implement and maintain computer systems mean.

Explanation:

Please check the answer section.

8 0
3 years ago
What is the need for using secondary memory devices?
Savatey [412]
Hi pupil here's your answer ::


➡➡➡➡➡➡➡➡➡➡➡➡➡

They are needed because of the following reasons :

》The storage capacity of primary memory is limited.

》 Primary memory (RAM) is volatile in nature.

》 RAM is not portable memory.

》 RAM chips are expensive. Increasing RAM will increase the price of the computer.

So, for the above reasons we need to use the Secondary memory devices.

⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅


Hope this helps . . . . .
7 0
3 years ago
Electronic type is often considered to be the latest step in the evolution of the written ______________.
Allisa [31]
It isn’t people but im really confused. I think its A but dont come at me if its wrong
4 0
3 years ago
Mention the usage of crop concept in ms-word​
nignag [31]

Answer:

Every image editing software has a crop tool that allows you to trim or eliminate the edges of an image. Cropping tools in Ms.word allow you to hide portions of picture that you do not want to be displayed in the final result.

3 0
3 years ago
Read 2 more answers
What is output?
andriy [413]

Answer:

The output of the following code is 3.

Explanation:

In the following Python Programming Language, the output is 3 because the variable x is equal to 21, then the user check the condition is the variable x is greater than 21 then print it print 1, otherwise the user check that the variable x is less than 21 then print 2, otherwise it print 3. So, the variable x is not greater than 21 or not less than 21, it is equal to 21. That's why the code execute the else block and print 3.

6 0
3 years ago
Other questions:
  • After Intel faced strong shifts in technologies, such as cloud services, social networking, mobile devices, etc., Intel realized
    11·1 answer
  • The bias condition for a transistor to be used as a linear amplifier is called:________.
    14·1 answer
  • When configuring services, what linux directory typically contains server configuration files?
    8·1 answer
  • Sara works in the IT department for a large retail store. She has been testing a theory about why an error message keeps popping
    14·1 answer
  • Crack the secret message: Crrp, Crrp, Crrp Zh’uh jrlqj wr wkh prrq. Li brx zdqw wr wdnh d wuls, Folpe derdug pb urfnhw vkls. (hi
    7·1 answer
  • A technician receives an invalid certificate error when visiting a website with port 443 enabled. Other computers on the same LA
    8·1 answer
  • Write a C++ Win32 Console Application that will use nested for loops to generate a multiplication table from 1 x 1 to 10 x 10. U
    12·1 answer
  • When you navigate inside a compressed folder, you click the
    6·1 answer
  • What can be viewed in the Tasks folder? Check all that apply
    14·1 answer
  • Data mining requires specialized data analysts to ask ad hoc questions and obtain answers quickly from the system. select one: t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!