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
On the first line, place your name in a comment. Create a program that does the following: Take in three integer numbers from th
Helen [10]

Answer and Explanation:

//buchi

Var firstNumber=prompt("please enter first number");

Var secondNumber=prompt("please enter second number");

Var thirdNumber=prompt("please enter third number");

Var numberTotal=firstNumber+secondNumber+thirdNumber;

Function calculateNumbers(){

return numberTotal;

return int(numberTotal/3);

return firstNumber*secondNumber*thirdNumber;}

Console.log(calculateNumbers());

8 0
3 years ago
What does SIP stand for?
agasfer [191]
Session Initiation Protocol, brainliest ?
4 0
3 years ago
Read 2 more answers
Leo needs to consolidate data in multiple worksheets by performing a calculation across all worksheets on the same cells.
wolverine [178]
A do you think is the answer
4 0
3 years ago
Read 2 more answers
If Scheme were a pure functional language, could it include DISPLAY ? Why or why not?​
VARVARA [1.3K]

Answer:

When Scheme is a pure functional language, it cannot include the function DISPLAY. Since the pure functional languages will return the same value whenever the same expression is evaluated, and the DISPLAY would be the output and thus it cannot be part of the purely functional language. Thus in the pure functional language we can evaluate the expressions with the same arguments and it returns the same value since there is no state to change.

Explanation:

4 0
3 years ago
5 minutes speech on computer and it's impact​
yuradex [85]

Answer:

used for inter eliptics

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is a useful policy to minimize waste and mistakes?
    6·1 answer
  • [Java] Using the comparable interface
    13·1 answer
  • A database administrator (DBA) must have a clear understanding of the fundamental business of an organization, be proficient in
    11·1 answer
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • A cybersecurity analyst is currently investigating a server outage. The analyst has discovered the following value was entered f
    9·1 answer
  • You’re driving down the highway when one of your tires suddenly blows out.<br> you should
    10·2 answers
  • Is the jane austen pride and prejudie a primary source
    6·1 answer
  • A gas furnace has an efficiency of 75% . How many BTU will it produce from 1000 BTU of natural gas​
    14·2 answers
  • Sustainable development is a goal towards which all human societies need to be moving. elaborate the statement in about 120 word
    9·1 answer
  • Why does my roku tv keep disconnecting from the internet.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!