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
Kay [80]
4 years ago
11

Assignment 1 is to write a program that will write the lyrics to "X number of beers on the wall". Use only the main method. Prom

pt for the initial number of bottles of beer on the wall. Confirm the value is greater than zero and less than 101. Your program should then generate the following console output. The example below assumes the number 3 has entered. You loop each time until there are 0 bottles of beer on the wall. 3 bottles of beer on the wall. 3 bottles of beer. Take 1 down, pass it around. 2 bottles of beer on the wall. 2 bottles of beer on the wall. 2 bottles of beer. Take 1 down, pass it around. 1 bottle of beer on the wall. 1 bottle of beer on the wall. 1 bottle of beer. Take 1 down, pass it around. 0 bottles of beer on the wall.
Computers and Technology
1 answer:
g100num [7]4 years ago
4 0

Answer:

// here is code in java.

import java.util.*;

class Main

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

       // variable to store the number of bottles

       int num_bot;

        Scanner scr=new Scanner(System.in);

        System.out.print("Enter number of bottles of beer on the wall:");

        //read the number of bottles

        num_bot=scr.nextInt();

        // print the output

        for(int i=num_bot;i>0;i--)

        {

         // print the first statement

         System.out.println(i+" beer bottles on the wall");

         // print the second statement

         System.out.println(i+" beer bottles . Take 1 down and pass the bottle around.");

         }

         // when there is 0 bottle

           System.out.println("0 bottles of beer on the wall.");

   }catch(Exception ex){

       return;}

}

}

Explanation:

Declare a variable "num_bot" to store the initial number of beer bottles.Then ask user to give number of bottles.Run a for loop to pass a beer bottle until there is 0 bottle on the wall. When number of bottle is 0 then it will print there is "0 bottle on the wall".

Output:

Enter number of bottles of beer on the wall:3

3 beer bottles on the wall

3 beer bottles . Take 1 down and pass the bottle around.

2 beer bottles on the wall

2 beer bottles . Take 1 down and pass the bottle around.

1 beer bottles on the wall

1 beer bottles . Take 1 down and pass the bottle around.

0 bottles of beer on the wall.

You might be interested in
How to build a 5*32 decoder by using 3*8 and 2*4 decoders? (digital design)
quester [9]
Assuming decoders with enabler.
input with rectangle is the ENABLE input.
wire with "/" on it is a bundled wire with multiple values to save drawing space.
In1 is MSB, In5 is LSB.

messy drawing as I'm in vehicle.

8 0
3 years ago
What two functions does tcp/ip perform?
svetlana [45]

The two functions does tcp/ip are:

  • Reassemble data packets at the destination.
  • Request servers for data the user wants.

<h3>What are the functions of TCP IP?</h3>

The role of the Transmission Control Protocol is known to be the one that helps to take in and put together the Data Packets while that of IP is to send the Data Packets to the right location or destination.

Therefore, The two functions does tcp/ip are:

  • Reassemble data packets at the destination.
  • Request servers for data the user wants.

Learn more about tcp/ip from

brainly.com/question/17387945

#SPJ1

4 0
2 years ago
Which of the following have the smallest file size
Alla [95]

Answer:

A.

Explanation:

Ebooks are typically only text, which is smal.

However, a Photo can be very small too, so the answer is not definitive.

3 0
3 years ago
"explain why professional software is not just the programs that are developed for a customer"
Darina [25.2K]

To put it into simple terms, software is always a continuous process of coding and updating, thus, you will never code and be done. Professional software not only consists of programs that are developed for a client, but also the compilation of documentation, configuration of data, support websites, requirements, design manuals, and evolution to make these programs operational and complete. 

A professionally done software system consists of more than one program and configuration files used to set up these programs.






5 0
3 years ago
What problems can arise if the client, developer, and user are the same person? How can these problems be solved?
Aloiza [94]

Answer:

1 - if all three are the same person then possibility of verifying the software or its scope for the general public will remain unknown

2 - it will not return any profit when all are the same person thus it will remain in one isolated environment

3 - it cannot be used by the masses if all three people are the same person

Explanation:

while building any software system it needs three sets of people who are an important part of this development chain. They are the client, developer, and user. if suppose all three are the same person while developing any software then some problems are occurring and that are mentioned below

1 - if all three are the same person then possibility of verifying the software or its scope for the general public will remain unknown

2 - it will not return any profit when all are the same person thus it will remain in one isolated environment

3 - it cannot be used by the masses if all three people are the same person

the one thing that needs to be done for removing all these problems is to assigned different people for different phases. so that the developer can validate the scope of software in the market.

5 0
3 years ago
Other questions:
  • Write a SELECT statement that returns an XML document that contains all of the invoices in the Invoices table that have more tha
    8·1 answer
  • The letters G,S and C are all examples of what Microsoft Word feature?
    12·1 answer
  • "_____ devices improve memory by encoding items in a special way."
    13·1 answer
  • How do you calculate typing speed
    8·1 answer
  • Think of an example in your life where a number could be described as data, information, and knowledge
    14·1 answer
  • What will the following program display in the console?
    12·1 answer
  • Say yes if you hate edge2021?
    8·2 answers
  • HURRYY!!!<br> In the movie "Spare Parts" why can't Oscar enlist in the armed forces????
    13·1 answer
  • What does a computer monitor look like when struck really hard?
    15·1 answer
  • Which factors have increased the need for the latest cybersecurity technologies?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!