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

Write the definition of a method printAttitude, which has an int parameter and returns nothing. The method prints a message to s

tandard output depending on the value of its parameter. If the parameter equals 1, the method prints disagree If the parameter equals 2, the method prints no opinion If the parameter equals 3, the method prints agree In the case of other values, the method does nothing. Each message is printed on a line by itself.
Computers and Technology
1 answer:
Jlenok [28]3 years ago
6 0

Answer:

public void printAttitude(int n){

   if(n == 1){

       System.out.println("disagree");

   }

  else if(n == 2){

      System.out.println("no option");

  }

  else if(n == 3){

      System.out.println("agree");

  }

  else {

  }

}

Explanation:

The above code has been written using Java syntax. The first line denotes the method header which contains the access modifier(public), followed by the return type(void), followed by the name of the method(printAttitude). The method name is followed by a pair of parentheses in which the parameter to the method is written - in this case - an int parameter, n.

Note: When a method does not return a value. It has a return type of void as shown on the first line of the code.

In the method body, a nested if...else statement is written to test for the value of the parameter. If the parameter value of n is 1, the string "disagree" is printed to the console. Else if the parameter value of n is 2, the string "no option" is printed to the console. if the parameter value of n is 3, the string "agree" is printed to the console. For other values of n, nothing is printed. This is shown in the body of the else statement.

Hope this helps!

You might be interested in
when files on storage are scattered throughout different disks or different parts of a disk, what is it called
mestny [16]

Answer:

File Fragmentation or Fragmented Files

3 0
3 years ago
2. You are developing a new application that optimizes the processing of a warehouse’s operations. When the products arrive, the
KonstantinChe [14]

Answer:

Option d) is correct

Explanation:

To optimize the processing of a warehouse’s operations, products are stored on warehouse racks when they arrive. The items that arrive last are the first to go out to minimize the time it takes to retrieve an item. The items that arrive need to be represented and the warehouse should be left in a data structure. The data structure which should you use to represent this situation is a queue.

Option d) is correct

5 0
3 years ago
____ is another term for document properties.
MArishka [77]
Metadata is the other term for document properties. It is a data that describes another data. The word “meta” means “an underlying definition or description”. Traditionally, it was used in libraries as card catalogs. In digitals, metadata is also used to describe digital data. 
3 0
3 years ago
The first window displayed when you install opensuse is the ____ window.
Jlenok [28]
Is the <span>Boot Options window.</span>
3 0
3 years ago
What countermeasures would you recommend to defend against routing attacks?
Alla [95]

Answer:

 The countermeasure is basically recommended against the attackers for defending various routing attacks. Routing is one of the most generally assaulted segments in a system and a lot of system the executives work centers around checking conduct of switches.

The single router has more than one unit for bundle handling. This encourages quicker handling. This preparing unit is finished programming which can be undermined by an aggressor.

So an additional free equipment is implanted into the switch which can do observing to recognize the product assaults. Maintain a strategic distance from over composition the addresses.

Be movement at time when all of a sudden if anything incorrectly happens we should be in a situation to deal with and deal with the issue since it causes more harm when time runs.

3 0
3 years ago
Other questions:
  • A _____ is a digital media file distributed over the Internet using syndication feeds for playback on mobile devices and persona
    6·1 answer
  • In a cellular network, where does each wireless base station connect to?
    9·1 answer
  • How to select the entire table in microsoft excel
    11·1 answer
  • HELP PLEASE ASAP!!! Does anyone know how to fix a broken iPhone which when I connect it to the charger it comes up with the Appl
    5·1 answer
  • How does the View tab of the ribbon allow you to look at a document?
    9·1 answer
  • Which model represents any process in general?
    6·1 answer
  • 1) a program that is designed to perform only one task.
    11·1 answer
  • A ……………………………is used to verify the identity of a website and is issued to the owner of the website by an independent and recogni
    7·2 answers
  • Write a C++ program to print name, age, class, school​
    12·1 answer
  • How do I text lauraasher811 on brainly?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!