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
Ainat [17]
3 years ago
13

Write the definition of a function printAttitude , which hasan int parameter and returns nothing. The function prints amessage t

o standard output depending on the value of itsparameter.a.If the parameter equals 1, the function prints disagree.b.If the parameter equals 2, the function prints no opinion.c.If the parameter equals 3, the function prints agree.d.In the case of other values, the function does nothing.
Computers and Technology
1 answer:
erastova [34]3 years ago
6 0

Answer:

The function definition to this question can be given as:

Function definition:

void printAttitude(int x1) //define function printAttitude.

{

//nested else-if statements

if(x1==1)

 //if block

cout<<"disagree"<<endl;

//message

else if(x1==2)

 //else if block  

cout<<"no opinion"<<endl;

//message

else if(x1==3)

 //else if block

cout<<"agree"<<endl;

//message

else

cout<<" ";

}

Explanation:

In the above method definition firstly, we define a method that is "printAttitude". In this method, we pass an integer variable that is "x1". This function does not return any value because its return type is void. In this method, we use nested else-if statements. The description of these conditions can be given as:

  • In the if block we check the variable x1 value is equal to 1 If this condition is true. It will print "disagree" otherwise it will go to else-if block.  
  • In the else-if block, we check the variable x1 value is equal to 2 if the condition is true. It will print "no opinion". otherwise, we will go to another else-if block.
  • In this block, we check the variable x1 value is equal to 3 if this condition is true. It will print "agree".otherwise it will go to else block.
  • In the else block it will print nothing.
You might be interested in
Which symbol is used for an assignment statement in a flowchart?
Pavlova-9 [17]

Equal symbol

equal symbol

Within most programming languages the symbol used for assignment is the equal symbol.

4 0
2 years ago
you want to implement a protocol on your network that allows computers to find the ip address of a host from a logical name. whi
aniked [119]

The protocol that should be implemented is that one needs to enable hosts on the network to find the IP address.

<h3>What is IP address?</h3>

It should be noted that IP address simply means a unique address that defines a device on the internet.

In this case, the protocol that should be implemented is that one needs to enable hosts on the network to find the IP address.

Learn more about IP address on:

brainly.com/question/24930846

#SPJ12

7 0
1 year ago
Is it more costly to Andrew to go to graduate business school full time or part time if the tuition is the same for each? A. Par
andrezito [222]

Answer:

A. Part time

Explanation:

Since tuition is the same whether he goes part time or full time, in the long run he will end up paying tuition a greater number of times if he is a part time student.

4 0
3 years ago
Read 2 more answers
Ill give 100 points to whoever gives me the CORRECT answer. I keep getting syntax errors when I do the "add:" part. Can someone
Olin [163]

Answer:

sorry but there is not enough information to complete this

Explanation:

6 0
2 years ago
Read 2 more answers
What are like arms surrounding all the other code blocks?
liq [111]

Answer:

Parenthesis

Explanation:

I code

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is a reason why the comments tool within PDF documents could be helpful? (Select all that apply.)
    5·1 answer
  • Which of the following statements is NOT true about a mainframe computer?
    14·1 answer
  • What UDP port is used by a default WDS server setup when it is listening for PXE boot requests​
    12·1 answer
  • String[][] arr = {{"Hello,", "Hi,", "Hey,"}, {"it's", "it is", "it really is"}, {"nice", "great", "a pleasure"},
    11·1 answer
  • Write a C program to calculate salary raise for employees. If salary is between$ 0 &lt; $ 30000 the rate is 7.0%If salary is bet
    8·1 answer
  • Use the drop-down menus to match each description with the part of a report where it is located.
    10·1 answer
  • I want to get an output picture in python but it says this. I'm using turtle
    12·1 answer
  • What is algorithm and how does it works​
    11·2 answers
  • QUESTION 44 To determine whether a character entered is a letter of the alphabet, use the ________ function. isdigit fromkeyboar
    6·1 answer
  • In _________, the process requests permission to access and modify variables shared with others. a) entry section b) critical se
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!