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]
4 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]4 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
This career involves answering questions about computer parts and trouble shooting broken computers? Video game designer, comput
adelina 88 [10]

Computer retail sales associate is my best guess. :)

3 0
3 years ago
Select the different network functions from the list below.
VashaNatasha [74]

Answer:

IP address

blocking spam

power

SAN

8 0
3 years ago
Choose the correct term to complete the sentence.
Diano4ka-milaya [45]

Answer:

Object-oriented programming

Explanation:

When used in object-oriented programming , a class is a factory for creating object. An object is a collection of data and behavaiors that represent some entity(real or abstract).

6 0
3 years ago
Which of the following is the best definition of metatheatre?
grandymaker [24]

Answer:"Metatheatre" is a convenient name for the quality or force in a play which challenges theatre's claim to be simply realistic -- to be nothing but a mirror in which we view the actions and sufferings of characters like ourselves, suspending our disbelief in their reality.

Explanation:

7 0
3 years ago
What piece of hardware directs traffic between the connected devices when two LAN's are communicating across the Internet?
luda_lava [24]

Answer:

The correct answer is "Router".

Explanation:

In networking, routers is one of the main hardware which is used to direct the data traffic on a LAN system.

The router also works as an interconnection system for two or more than two networks. Routers mostly work between the internet and computer which directs the data to its right path.

It works between the computer system in a premise to make the networking possible through a LAN by using switches for communication between two or more than two devices in a LAN across the internet.

Hence, the most appropriate answer is the router.

3 0
3 years ago
Other questions:
  • What does ADSL stand for?
    6·2 answers
  • In GamePoints' constructor, assign teamWhales with 500 and teamLions with 500. #include using namespace std; class GamePoints {
    13·1 answer
  • When using a file name you have to use only lower case letters<br>true or false
    11·1 answer
  • Choose a simple way to let a VPN into your VPC continue to work in spite of routing changes.
    15·1 answer
  • What type of coverage pays for damage incurred as a result of theft, vandalism, fire or natural disaster?
    15·1 answer
  • The _____ feature will mark all changes made to a document for others to review at a later time.
    13·1 answer
  • Tables should be used when (a) the reader need not refer to specific numerical values. (b) the reader need not make precise comp
    14·1 answer
  • OSI layer for HDLC??​
    13·1 answer
  • Check image dont answer if you dont know please
    13·1 answer
  • Identify the calculation performed by the following code.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!