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
tatuchka [14]
3 years ago
9

Given that a function receives three parameters a, b, c, of type double, write some code, to be included as part of the function

, that determines whether the value of "b squared" – 4ac is negative. If negative, the code prints out the message "no real solutions" and returns from the function.
Computers and Technology
1 answer:
Ray Of Light [21]3 years ago
4 0

Answer:

The function, having three double parameters, for the given scenario in c++ is given below.

void calc(double a, double b, double c)

{

   double res, s;

   s = b*b;

   res = s - (4*a*c);

   if(res < 0)

       cout << "no real solutions" << endl;

}

Explanation:

A function is declared as follows.

return-type function-name (parameter1, parameter2, … )

1. The return-type can be void or any other data type in c++ language. Void indicates that the function does not returns anything. Other data types indicate that the function returns a value of that particular data type.

2. Here, the return type is taken as void since question does not asks to return any value from the function.

3. The function-name is the name of the function. The naming conventions are similar to those defined for variables in c++.

4. The brackets following the function-name consists of the parameters. The parameters are optional and the bracket can be empty.

5. The parameters are declared in the same way as the normal variables.

The function executes as explained.

1. The function calc() receives three double parameters a, b and c.

2. No user input is taken inside the function.

3. Two additional variables are declared which are used as given below. These variables are also declared as double.

4. Square of value in variable b is stored in the variable, s.

5. The final value of the expression, s - 4ac (equivalent to b squared – 4ac), is stored in the variable, res.

6. If the value of variable res is less than 0 or negative, the function displays a message, “no real solutions” to the standard output.

7. If the value of variable res is more than or equal to 0, the function does not display any message to the standard output.

8. As per the question, message should be displayed only for the negative value of the expression.

You might be interested in
The internet maybe best compared to what
attashe74 [19]
The internet can be compared to many stuff, such as a world wide web, or a huge box with stuff and you put in what you want and it comes out! 
6 0
3 years ago
The members of the IT department have spent two days debating the best approach to roll out the new software update. After allow
devlian [24]

Answer:

<em>Functional conflict</em>

Explanation:

Functional conflict means<em> encouraging workers to communicate different points of view and address disagreements in a healthy manner that can promote new ideas and new innovations.</em>

This compares with the unstable type of conflict that has no business advantage and only hurts the morale of interaction, productivity and workplace.

4 0
3 years ago
A(n) _________________________ is a character that word displays on the screen but is not visible on a printed document.
oksano4ka [1.4K]
Nonprint ...but im like 99 percent sure
6 0
3 years ago
¿Cuales son las empresas mas exitosas que aún usan hoja de cálculo? porfa es urgentee
dem82 [27]

Answer:excel

Explanation:

6 0
2 years ago
Which is the best description of a hierarchical report?
mixas84 [53]

Answer:

d

Explanation:

a report with records sorted in ascending order is the right answer

6 0
3 years ago
Other questions:
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • What is the most efficient way to include a space after each paragraph?
    13·2 answers
  • Word offers a multitude of picture formatting options that allow you to flip, rotate, and make many other adjustments to inserte
    15·1 answer
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • A _____ is a harmful program that resides in the active memory of a computer and duplicates itself. Select one: a. scareware b.
    7·1 answer
  • Which of the following is NOT contained on the Slide Show toolbar?
    11·2 answers
  • How can i address inv file in c for open it?
    13·1 answer
  • You have just finished installing a network adapter adapter and booted up the system, the drivers. You open File Explorer on a r
    13·1 answer
  • Why is operating system important software for computer?give 3 reasons
    8·1 answer
  • what is the correct process for setting up a recurring project for the same client in qbo accountant?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!