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
Explain with examples what is software​
zvonat [6]

Answer:

Software is the data in your computer for example apps

Explanation:

Apps are a form of software

8 0
2 years ago
How do u set up a Wi-Fi network on Android ​
AlladinOne [14]

Answer:

These are some way I know

5 0
3 years ago
Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the ra
Kazeer [188]

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

class Circle{

// private member variable named radius

private:

double radius;

// get function for radius

public:

double getRadius(){

return radius;

}

// set function for radius

void setRadius(double rad){

radius=rad;

}

// returning area = 3.14159 * radius * radius

double getArea(){

return (3.14159 * radius * radius);

}

};

// Sample run

int main()

{

// Declaring object of Circle

Circle myCircle;

myCircle.setRadius(5);

// printing radius of circle

cout<<"Radius of circle is: "<<(myCircle.getRadius())<<endl;

// printing area of circle

cout<<"Area of circle is: "<<(myCircle.getArea())<<endl;

return 0;

}

4 0
3 years ago
public class Questions { public static void main(String[] args) { System.out.print("Here "); System.out.println("There " "Everyw
In-s [12.5K]

Answer:

The output of this code can be given as follows:

Output:

Here There Everywhere

But notin Texas

Explanation:

In the give java code a class "Questions" is defined inside this class the main method is defined in the main method we use three print function that can be described as follows:

  • In the first print function, we print the message that is "Here".
  • In the second and third print function, we use println that print data or message in the next line that is "There Everywhere" and in the next line  "But not" and "in Texas".
6 0
3 years ago
Match the appropriate color mode with the correct definition
Gemiola [76]

Answer:

1.RGB: Best for projects intended to be used on the web or video

Explanation:

On websites or making project RGB combination of colors is used. This combination of colors is used to store images in electronic components.

2. CMYK: best for professional printing projects using process colors

Explanation:

Printing professional use CMYK combinations of color for better printing results.

3.) indexed:The only colors saved are the colors used in the image

To manage digital images we use Indexed mode of colors.

Explanation:

4.) bitmap: uses black and white

Explanation:

bitmap is the combination of the black and white colors. As the images are large in size so that, to reduce the size of the image we store image in bitmap to reduce the size.

5.) gray scale: uses different shades of grey

Explanation:

The different shades of gray colors are found in the gray scale. These shades are used to produce images.

4 0
3 years ago
Other questions:
  • 2. a. Write pseudocode for a divide-and-conquer algorithm for finding valuesof both the largest and smallest elements in an arra
    11·1 answer
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • 13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
    15·1 answer
  • There was an airplane crash, every single person on board died, but yet two people survived. How is this possible?
    5·2 answers
  • Create a dictionary named letter_counts that contains each letter and the number of times it occurs in string1. Challenge: Lette
    14·1 answer
  • In this exercise, you are given a phrase and need to return that phrase in all capital letters.
    6·1 answer
  • Write the definition of a method min that has two int parameters and returns the smaller.
    9·1 answer
  • An IP address in the form 197.169.100.1 is called a(n) ________. dotted quad encryption key random number sequential access numb
    7·1 answer
  • Which terms means device that converts one voltage to another ?
    15·1 answer
  • In order to preview an attachment in an e-mail, click the attachment in the ______
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!