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
Viktor [21]
3 years ago
12

Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (a

nd hopefully funny) ways.
Write a program that takes a string and integer as input, and outputs a sentence using those items as below. The program repeats until the input string is quit.

Ex: If the input is:
apples 5
shoes 2
quit o

the output is:
Eating 5 apples a day keeps the doctor away.
Eating 2 shoes a day keeps the doctor away.

Note: This requires the use of a loop.
Computers and Technology
2 answers:
oksano4ka [1.4K]3 years ago
8 0

Answer:

The program to this question can be defined as follows:

Program:

import java.util.*; //import package

public class Main //defining class

{

   public static void main(String[] as) //defining main method

   {

       Scanner ax= new Scanner(System.in);//create Scanner class object for user-input

       String val; //defining String variable

       int x;//defining an integer variable

       System.out.print("Enter string value first then numeric, and for exit 'quit & 0': \n");

       val = ax.next(); //input value

       x = ax.nextInt();//input value

       while(!(val.equals("quit") && x==0)) //Check value

       {

           System.out.println("Eating "+x+" "+val+" a day keeps the doctor away."); //print value

           val = ax.next(); //input value

           x= ax.nextInt(); //input value

       }

   }

}

Output:

Enter string value first then numeric, and for exit 'quit & 0':  

apple 5

Eating 5 apple a day keeps the doctor away.

shoes 2

Eating 2 shoes a day keeps the doctor away.

quit 0

Explanation:

In the above program, two variable "val" and "x" is declared, in which "val" is string variable and "x" is integer variable, in the next line, a while loop is declared, which can be described as follows:

In the loop, a condition is checked, that "val" is equal to "quit" and x is equal to "0", inside the loop, it will input value from the user-end.  

Alisiya [41]3 years ago
7 0

Answer:

in python:

while True:

   inter,string= input().split() #use split to write input in the same line

   if(inter=="quit"):

     break

   else:

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

Explanation:

You might be interested in
Order the steps to use a logical argument as a rule type.
muminat

Answer:

Click home tab, click conditional formatting, click new rule, use formula to determine

6 0
3 years ago
Read 2 more answers
A program that performs handy tasks, such as computer management functions or diagnostics is often called a/an ____________.
Elodia [21]

Answer:

DOS

Explanation:

Disk operating

4 0
2 years ago
The instant pivot button is displayed in the statistics and visualization tabs when a _______ search is run.
Arisa [49]

Answer:

<h2>The instant pivot button is displayed in the statistics and visualization tabs when a <u>non-transforming</u>  search is run. </h2>

Explanation:

<h3>Transforming Search:</h3>

It can be defined as a search in which transforming commands are used that involve, charts and stats to convert data of events that is gained by the search in to tables (statistical). These tables can further be used for the basis of visualizing data in the form of charts.

Non-Transforming Search:

The search that do no contains produce event lists that can be viewed in Events tab. while using non-transforming search, i we want to generate tables or charts we must follow the points below:

  • Click ob statistics and Visualization tab.
  • Select pivot to open the search.
  • All the visualizations can be generated in this editor.

<h2>i hope it will help you!</h2>
5 0
4 years ago
Your enterprise LAN uses a VPN so that users working from home can access shared Windows folders in the office, but it doesn't w
Alona [7]

Explanation:

Rather than use LAN or VPN remote connections, cloud services may be a better option to use. They could focus on using alternate remote file access services such as Google Drive, Dropbox, etc. Using these alternative services would be best suitable for unreliable or limited internet connections.

Also, it would be best if remote users download/store important folders when in an area having a stable internet connection.

6 0
3 years ago
When performing the ipconfig command, what does the following output line depict if found in the tunnel adapter settings?
Andrew [12]

Answer:

d. IPv4 Address 192.168.0.4 is associated with the globe IPv6 address 2001:db8:0:10:0:efe

Explanation:

The adapter setting will be associated with the global IP address. When Ipconfig command is operate the IP address finds the relevant domain and then address will use a different subnet. The network will use both IPv4 and IPv6 subnets in order to execute the command.

8 0
3 years ago
Other questions:
  • What is the outlined area called?
    6·1 answer
  • Plz tell me a storage device that should be used for this and why
    11·1 answer
  • _________ is the process of scanning the network to find out which Internet Protocol (IP) addresses are attached to potentially
    9·1 answer
  • What country threatens Denmark at the beginning of Hamlet as evidenced in Marcellus’s question, "Why this same strict and most o
    13·1 answer
  • Method x1() has code that calls method x2(). Method x2() has the following header.
    7·1 answer
  • If you were setting up a network with 100 nodes and you wanted no more than 25 nodes per segment: what devices and connections w
    9·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • Write a program in python to test if given number is prime or not.
    6·2 answers
  • How are computers used in education and entertainment? List them.​
    10·1 answer
  • Una laptop agarra mas internet que una computadora de escritorio?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!