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
What is the name for the type of flash memory that is used by mobile devices to store their apps and data?
tankabanditka [31]
D. Solid state is correct
5 0
3 years ago
Nearly all personal computers are capable of serving as network servers.
Mashutka [201]
True
yes computers are capable of serving network servers.
6 0
3 years ago
Read 2 more answers
What is modem please give me answer​
rjkz [21]

Answer:

a combined device for modulations and demodulations

4 0
3 years ago
Why has Unicode become the standard way of converting binary to text?
Zigmanuir [339]
The standard for internal text coding system is called Unicode (Encoding, representation and handling text). Nearly every operating system uses this. The basic reason for choosing Unicode for converting binary to text is because this is compatible with almost every language in the world making it popular. Although there are other ways to do this, Unicode stays popular of all.
5 0
3 years ago
HELPPP!!!!!!
liraira [26]
The answer is 1.7 billion
4 0
3 years ago
Other questions:
  • An online survey is an effective way for an administrative professional to gather information. True False
    13·1 answer
  • A wireframe is a sketch detailing where text and images will be placed on a website. T/F
    11·1 answer
  • Which is an acceptable practice when a photographer shoots in windy conditions?
    14·1 answer
  • What element is not a selection in the Interface preferences? UI Character Presets UI Font Size UI Language UI Scaling
    9·1 answer
  • The parameter passing mechanisn used in C is
    5·2 answers
  • What is the function of a breadcrumb trail website
    7·1 answer
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • The full meaning of UNIVAC and ENIAC​
    5·2 answers
  • Does anyone know how to permanently delete photos on a dell computer? For my cousin.
    12·1 answer
  • What do we call the software which programmers use to program?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!