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]
4 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]4 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]4 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
You are working on a project to develop a new or enhanced system to help people at your college, university, or organization to
ArbitrLikvidat [17]

When you are working on a project to make or better a system to help people at your college or workplace to find jobs, then the system should be made for the student and work for the population and should be simple so people can work their way around it. You can use these following techniques.

  • Interviewing is a good way to have face to face and more interactive ways to communicate with your colleagues and clients. Unlike the next one which is a survey, this can be more personal and you'll get better answers than a computer program could.
  • Surveys are a great way to collect data and get people's opinions! It is also faster and more efficient if you're on a tight schedule.
  • A document analysis are the last ones to mention here. You can see how an already existing system is working and make a study based on that.

Five requirements in a traceability matrix that I would use are the following:

  1. Plan meetings with stakeholders who may want to work with your system development because they'll be the first ones that are upfront and into the project.
  2. Make more meetings and surveys to help people who are using your system do its purpose of finding people jobs at the workplace and college.
  3. Study your system to make sure it works and then do an analysis
  4. Make sure you do effective system documentation preparation and make sure to also have nice and helpful guides and other things that can help you and your system development.
  5. Have a team of Business Analysis visits stakeholders who will show them the ropes of the business requirements and how the system is being made and what design is going to be put out of the system.

Hope this helps. HAVE A BLESSED AND WONDERFUL DAY! As well as a great rest of Black History Month! :-)  

- Cutiepatutie ☺❀❤

6 0
4 years ago
1. Write a query in SQL to list the following information of the artists in movie industry. Limit this information to only 5 art
Rudik [331]

Answer:

1) SQL Server

SELECT  Top 5 concate(first name,' ',last name) AS Full name, Current age AS Age, state AS Address, Phone number AS Contact number from actor ORDERBY Current age DSC ;

2) MySQL

SELECT  concate(first name,' ',last name) AS Full name, Current age AS Age, state AS Address, Phone number AS Contact number from actor ORDERBY Current age DSC limit 5;

Explanation:

There two queries first having syntax works fine in SQL server and later with MySQL. All bold faced words are sql keywords. I assumed the tablename is actor as table name is not given if table name is any other replace actor with that name.

6 0
3 years ago
Marissa, a 21-year-old young woman, is working as an intern at a software company. She has recently graduated from college. She
Zigmanuir [339]

Answer:

She is experiencing the features of feeling in between.

Explanation:

Because she graduated from college currently and she thinks about moving seriously with her boyfriend or best friend and she also thinks about the convenience and safety which she gets in her parents' house. She confused because she is not completely in the adult stage and currently, she passed through from the stage of adolescence, so that's why she experiencing feeling in between.

3 0
4 years ago
MICR is an input or output devices
Nataly [62]

Explanation:

If a device is putting data into the computer in the form of text, sound, images, button presses etc. then it is an input device, if the device is outputting things from the computer such as sound, movement, printing, images etc., then it is an output device. ... Therefore it is an input device.

8 0
3 years ago
The memory units that follow are specified by the number of words times the number of bits per word. how many address lines and
statuscvo [17]
A) - 2G = 2 * 2^30 = 2^31 words therefore you need 31 bits to specify a memory location( 31 address line). 
<span>- If your word has 32 bits then you need 32 data lines. </span>
<span>- The # of bytes is (2 * 2^30 * 2^5 )/ 8 = (2^36) / 8 = 2^36 / 2^3 = 2^33 bytes </span>
8 0
3 years ago
Other questions:
  • Before entering a loop, the first input, or ____, is retrieved.
    14·1 answer
  • Which statement describing an operating system's Search feature is true?
    5·1 answer
  • Contextual targeting method mean
    11·1 answer
  • Why is it a good idea to understand what you are good at and what you enjoy
    11·2 answers
  • 24. The central processing unit (CPU) consists of two parts which are a. the input and output devices b. the control unit and th
    13·1 answer
  • How can parents be health educators in family​
    13·1 answer
  • Who is the founded the java computer language?​
    5·1 answer
  • PLZZZZ HELPPP and please don’t send a link , Explain how the processing stage contributes to a computer creating an output.
    8·1 answer
  • Will creates an entry in his calendar and marks it as an all-day instance. Which item has he created?
    10·1 answer
  • The short-range two-way communication technology behind contactless payments is called ____.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!