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
VMariaS [17]
3 years ago
8

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 0.Ex: If the input is:apples 5shoes 2quit 0the 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.import java.util.Scanner;public class LabProgram {public static void main(String[] args) {/* Type your code here. */}}

Computers and Technology
1 answer:
Marina86 [1]3 years ago
3 0

Answer:

I am writing a C++ and JAVA program.    

import java.util.Scanner; //for using input output functions

public class LabProgram { // class name

public static void main(String[] args) {//start of main function body

Scanner input = new Scanner(System.in);

// creates input instance of  Scanner type

     String str;  // declares String type variable str for a string value

     int num;  // declares integer type variable num to hold an integer value

     str = input.next(); //scans and reads input string from user

     num = input.nextInt();  //scans and reads input integer from user

//while loop continues to execute until user enters quit 0

while(str!="quit" && num!=0) {  

/* prints the following message, for example if value of num = 2 and value of str = apples then the following print statement prints Eating 2 apples a day keeps the doctor away. */

System.out.println("\nEating " + num +" " + str + " a day keeps the doctor away.");

//takes string and integer as input again and keep taking input until user //enters quit 0

str = input.next();  

num = input.nextInt(); }   } }

Explanation:

The program is well explained in the comments mentioned with each statement of the program. The program simply prompts user to enter a string and an integer. The while loop keeps executing until user enters quit 0. The program keeps taking input string and integer from user and prints the message System.out.println("\nEating " + num +" " + str + " a day keeps the doctor away.");  The loop breaks when the use enters quit 0. The screenshot of the program along with its output is attached.

You might be interested in
The _____ option will allow a user to remove text from one location and keep it for use later on the clipboard.
ValentinkaMS [17]

I believe the answer is the "cut" option?

8 0
3 years ago
In python, what is the difference between a dictionary and a set? How are they similar?
yuradex [85]

Answer:

"A set is an unordered collection. A dictionary is an unordered collection of data that stores data in key-value pairs."

Explanation:

Set =>

Collection of non-repetitive elements.

Unordered

Unindexed

No way to change items.

Dictionary =>

Collection of key-value pairs.

Unordered

Indexed

Mutable

4 0
2 years ago
Suppose there are two ISPs providing WiFi service in a café. Each ISP operates its own AP and has its own IP address block. If b
Alinara [238K]

Answer:

As a design rule, access points within range of each other should be set to channel frequencies with minimal signal overlap. Users will find that roaming doesn’t work well, and performance will degrade because of interference between access points.

Explanation:

8 0
3 years ago
_______For the C programming language, files containing the code you write are named with a file extension of .g. (T/F)
erastovalidia [21]

Answer:

False.

Explanation:

In C programming language the file which containing the code that we are writing the code is have the file extension .c and for c++ it is .cpp.  C programming language is a general purpose procedural computer programming language.

.g file extension is for data chart file format used by APPLAUSE database development software.

Hence the answer to this question is false.

4 0
3 years ago
What are some particular game ideas for a Roblox developer. *Ideas that weren't copied or done before (simulators, tycoons, you
Helga [31]

Hi! I've also been playing Roblox since 2009, and I know the struggle of wanting to create an "original" game that hasn't been made before on Roblox.

As a member of RAT and a fan of Polymorphic's games in that group, I just wanna say that the games you were a part of (and others, I'm sure) are amazing.

As for original games, that's unfortunately pretty difficult because Roblox Studio and the Roblox platform has some limitations as to what games you can create. However, I can still offer some ideas that I've always wanted to make, but couldn't because of my lack of scripting/building ability.

I used to be a huge fan of Pokemon, and games like Pokemon Arena X on Roblox. I've always wanted to make a game based off Pokemon, except instead of being limited to using 6 Pokemon at a time, I'd want to be able to build an army. For example, I want to be able to fight other trainers by commanding and summoning my various groups of Pokemon while flying on my Dragonite. Or having a separate cutscene when you encounter another trainer that looks something like Warlords 2: Rise of Demons (search this up on Google and you'll be able to see the format I'm talking about for a fight scene). If not a Pokemon conquest, maybe just another Pokemon minigame; those were always popular but ended up being deleted for reasons I'm not 100% sure of.

I've also always loved action games. What about making a game where you kill other Robloxians, but in order to do so, you have to possess NPCs within the game? You're a spirit with no power except the a starterpack of a few weapons and the ability to take over NPC bodies or characters, ranging from a snail that is extremely slow to someone who owns a gun or tank or whatever. I've never really thought about the details, but you can only possess a character for a certain amount of time before they realize they're being possessed and expel you. Then to switch "bodies", you have to spin a wheel or something and you can integrate game passes to improve probability.

These are just some ideas that you definitely don't even need to consider, and may not even be possible to integrate on Roblox's platform. But feel free to respond with your feedback or even add me on Roblox if you want to collaborate more. Just respond with your wishes and I'll get back to you when I come onto Brainly again.

Hope I was able to help :)

4 0
3 years ago
Read 2 more answers
Other questions:
  • What type of attack intercepts communication between parties to steal or manipulate the data?
    13·1 answer
  • Write a program to calculate how much to tip a waiter person based on the quality of service. The script file should ask for the
    12·1 answer
  • How do you change your age on here? I accidentally put that i was 15 but i am only 13. How do I change this?
    12·1 answer
  • Since the 1960s, there have been five major generations, or cycles, of computing. Which represents those generations in order?
    15·1 answer
  • Can you please help me with the AP Computer Science Fill in the blank. What goes on number 5 8 and 18. I don’t understand this I
    8·1 answer
  • Which symbol would be used in a flowchart to represent a connection to another part of the flowchart
    5·1 answer
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    14·1 answer
  • I need a computer science help.....and I rlly want it right now...this the question
    10·1 answer
  • Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number fo
    5·1 answer
  • Frequently used _____________ can be saved as _____________ for use in analysis, dashboards, reports, tickets, and alerts.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!