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
which of these paste options is commonly available from the paste options button? A&gt; use the destination them. B. keep the em
Anuta_ua [19.1K]
The correct option is D, PASTE AS CONTENT ONLY.
The paste option is the one which allows one to copy the content in a particular page and put it another space or page. The paste command has many options depending on the software that one is using, whether it is word, excel or power point. These options allow one to customize the copied and pasted content. One of the options that are usually available under paste option is paste as content only.
6 0
3 years ago
Read 2 more answers
What is GIGO ?<br>plz answer me​
DanielleElmas [232]

Answer:

Garbage in, garbage out

Explanation:

In computer science, garbage in, garbage out is the concept that flawed, or nonsense input data produces nonsense output or garbage

4 0
2 years ago
Assume the existence of a class named window with functions named close and freeresources, both of which accept no parameters an
denis-greek [22]
In your question whereas there is a class named window and it would be like this:

class window {
//code here 
}

Next is there is a function called close and freeresource and it goes like this:

class window{
  function close( ){
   //code here
  }
  function freeresource( ){
  // code here
  }
 public destruct (){
this.close();
this.freeresource();
}

}
The last code function destruct invokes the function close and freeresource. Hope this would help 

7 0
3 years ago
For question 1-3, consider the following program: def tryIt(a ,b = 7) return a + b
tino4ka555 [31]

Answer:

1)18

2)4

3)28

Explanation:

1) ans= tryIt(2) *2

        = (2+7)* 2 =18

2) ans= tryIt(-5) *2

        = (-5+7)* 2 =4

3) ans= tryIt(7) *2

        = (7+7)* 2 =28

3 0
3 years ago
________ is digital textual information that can be stored, manipulated, and transmitted by electronic devices.
mars1129 [50]
E-text <span>is digital textual information that can be stored, manipulated, and transmitted by electronic devices. The term "e-text" stands for electronic text and it is used for any digital document written, read, transmitted or manipulated by electronic devices, such as smart phones, PCs, tablets,...The origins of the e-text are in the beginning of the Internet.</span>
7 0
3 years ago
Other questions:
  • At the dsl local carrier's office, the __________ demultiplexes the data streams and converts them into digital data.
    10·1 answer
  • A(n) ____ backup only archives the files that have been modified since the last backup.
    11·1 answer
  • What feature of Windows Server allows for agentless authentication?
    7·1 answer
  • A Network Attached Storage device is good for _____.
    11·2 answers
  • End user needs assessment is a formal procedure to analyze a user's computer needs; it involves a specific set of steps that are
    8·1 answer
  • I have an airsoft pistol and I needed to take it apart to repair it and I lost some screws that were tiny and I dont know what t
    14·1 answer
  • Circular errors are caused by adding the cell name of a/an _______ cell to a formula.
    6·2 answers
  • Which descriptions offer examples of Correction Services workers? Select all that apply.
    8·1 answer
  • What is the HCF of smallest prime number and the smallest composite number?​
    12·1 answer
  • Elan inserted shapes into a slide in his presentation. What is the quickest way to format those shapes?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!