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]
4 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]4 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
What is the syntax of an of if statement
Usimov [2.4K]
The syntax for a if statement is; The condition evaluates for either true or false. True is always a non-zero value, false is a value that contains zero
6 0
3 years ago
Select all that apply.
Serhud [2]

Answer:

Page grouping

Page Setup grouping

Layout grouping

Schemes grouping

4 0
3 years ago
ILL GIVE BRAINLIEST IMMEDIATELY PLEASE HELP
katovenus [111]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
A network that operates without relying on a server is the ________ network.
Arlecino [84]
A network that operates without relying on a server is the nternet network
5 0
4 years ago
it has been said that television has little real educational value. what is your opinion on this issue?
damaskus [11]
It does, it has a lot of resources that we can take advantage of. It depends on how you use it
3 0
3 years ago
Other questions:
  • The default primary key for an access database is the id field true or falser
    7·1 answer
  • Dialogue is not a characteristic of functional text because
    9·1 answer
  • Explain why living things store energy in lipids instead of in carbohydrates
    5·1 answer
  • 3. By eliminating data redundancy, you're enforcing data A. validation. B. integrity. C. consistency. D. accuracy.
    14·2 answers
  • Apollo Couriers, a company providing international express mail services, has a proactive customer communications team. The prim
    8·1 answer
  • In the Microsoft Office Suite, what tells a database what to insert information in the document? 
    8·1 answer
  • The data-mining technique that creates a report or visual representation is _____.
    13·1 answer
  • Please can someone help me with this?
    6·1 answer
  • 2. Choose all of the correct answers for each of the following: [a] The relations of two sub-entity sets of the same super entit
    6·1 answer
  • A Python programmer is writing a function definition. What syntax should be used?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!