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
Give ways on how to effectively save.​
sp2606 [1]

Answer:

Explanation:

say goodbye to debt. Monthly debt payments are the biggest money suck when it comes to saving. ...

Cut down on groceries. ...

Cancel automatic subscriptions and memberships.

4 0
2 years ago
What is the range for copper tape
jeyben [28]

Answer:

I like the song "Angel"

3 0
2 years ago
Sarah has entered data about football players from team A and team B in a worksheet. She enters names of players from team A wit
deff fn [24]
I believe the answer is freeze pane view

7 0
3 years ago
Read 2 more answers
Canadian Tire is one of Canada’s largest companies. They operate four large distribution centers service over 470 tire retail ou
olganol [36]

Answer: Provided in the explanation section

Explanation:

A YMS acts an interface between a WMS and TMS.The evaluation system with the key performance indicators are mentioned in the table below.

NOTE: The analysis follows in this order given below

  • Metric
  • Description
  • Comments

Metric 1

<u>Trailer utilization</u>

Description :This captures the status of the trailer whether it is in the yard or is in transit

Comments : Helps in measuring the trailer productivity on a daily ,weekly or monthly basis

Metric 2

<u>Driver utilization</u>

Description : This captures the status of the driver whether the driver is in the yard or is in transit

Comments : Helps in measuring the driver productivity on a periodic basis

Metric 3

<u>Trailer sequence</u>

Description : This captures the order of movement of trailers in the yard on a given day, week or month

Comments : Helps in measuring the order fulfilment efficiency i.e. whether the priority orders have been serviced first or not

Metric 4

<u>Total time in yard</u>

Description : This captures the time spent by the trailer in the yard from the time it enters and leaves the yard

Comments : This helps in measuring the time taken to fulfill a particular request

⇒ Capturing these metrics need inputs from both WMS and TMS, and also the trailers need to have RFID tags attached to them.Then compare these performance metrics with the ones prior to the deployment of YMS to identify the percent gains in the overall operational productivity.

cheers i hope this helped !!

8 0
3 years ago
PLEASE HELP!!!!!!!!!!!
Dafna1 [17]
I'd say Davis was trying to increase persuasive power. Given that he saw that nobody was really his friend because he was shy and quiet, he tried to persuade people to like him by going to the game and hanging out with people. 
4 0
3 years ago
Read 2 more answers
Other questions:
  • Below is a chart representing portions of resumes from 3 applicants. Which best explains the applicants careers?
    11·1 answer
  • Business Risks are ​
    15·1 answer
  • What is the unique impact him professionals have on coded data?
    11·1 answer
  • A) Write 600 as the product of prime factors.<br> Give your answer in index form.
    7·2 answers
  • Match each word to its correct meaning.
    11·1 answer
  • What is DATE data type and its syntax and what is TIMESTAMP data type and its syntax in SQL language.Explain the difference betw
    14·1 answer
  • Wrtie down some containerization technology.
    11·1 answer
  • HW2.24. Statement: Area of a Triangle The area of a triangle can be computed by knowing the base and height of the triangle usin
    11·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
  • Why is quantum computing potentially a better fit for weather forecasting than classical computers?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!