subject
Computers and Technology, 12.11.2019 19:31 Sidm29

Write the definition of a method printattitude, which has an int parameter and returns nothing. the method prints a message to standard 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.

here is what i have so far that is being marked incorrect:

public static void printattitude (int x)

{

if (x==1){

system. out. println("disagree");

}

if (x==2){

system. out. println("no opinion");

} if (x==3){

system. out. println("agree");

}

}

here is the error message that i get:

- nothing was printed to stdout

- stdout is not correct

test case table

test case x stdout feedback

#1 1 disagree

#2 2 no opinion

#3 30 - stdout is not correct

- nothing was printed to stdout

#4 9 - stdout is not correct

- nothing was printed to stdout

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message ā€œconstructingā€. write a main()function that instantiates one object of the testclass. save the file as testclass.cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array.c . run this program and observe the results.
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 23.06.2019 03:10
Acomputer has a two-level cache. suppose that 60% of the memory references hit on the first level cache, 35% hit on the second level, and 5% miss. the access times are 5 nsec, 15 nsec, and 60 nsec, respectively, where the times for the level 2 cache and memory start counting at the moment it is known that they are needed (e.g., a level 2 cache access does not even start until the level 1 cache miss occurs). what is the average access time?
Answers: 1
You know the right answer?
Write the definition of a method printattitude, which has an int parameter and returns nothing. the...
Questions
question
Physics, 25.06.2020 06:01
Questions on the website: 13722360