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
Which of the following is NOT a long-term storage device?
neonofarm [45]

The storage device which is not a long-term storage device is: D. RAM.

<h3>Types of computer memory.</h3>

In Computer technology, there are two (2) main types of memory or storage location for software program (application) that are being used on a computer and these include the following;

  1. Read only memory (ROM)
  2. Random access memory (RAM)

<h3>What is RAM?</h3>

RAM is an abbreviation for random access memory and it can be defined as a volatile and temporary storage (memory) location that is used for currently opened software program (application) and computer data.

In conclusion, we can reasonably and logically deduce that the storage device which is not a long-term storage device is random access memory (RAM).

Read more on RAM here: brainly.com/question/13748829

#SPJ1

3 0
1 year ago
Consider the following class:
Pachacha [2.7K]

Answer:

c.return Integer.compare(value, otherTemp.value)

Explanation:

The compare() method as the name implies compares two integer values. If they are equal it returns 0, if the first number is smaller it returns -1, and if the first number is greater it returns 1.

It is an Integer class method that is why you need to type Integer.compare() to call the function.

For this example, the parameters that will be compared are <em>value</em>, and <em>otherTemp.value. </em>The type of compareTo method is an integer, we need to return the result.

3 0
3 years ago
Which of the following modes of replication requires a very low latency network connection and ensures data remains in synch wit
Snowcat [4.5K]

Answer:

b. Synchronous replication

Explanation:

Replication of data in storage partitions or in a number redundant array of independent disk drives helps to promote redundancy, as implied, and faulty tolerance to reduce loss of data.

There are two categories of replication and they are synchronous and asynchronous replication.

Synchronous replication requires low latency network site to mirror data, while asynchronous replication mirrors data in large metropolitan area in high latency networks.

4 0
3 years ago
Worksheet titles and subtitles should be as wordy as possible.<br> a. True<br> b. False
Maru [420]
B) false, as you want them to be as simple as you can... the 'wordy' part comes underneath said title :)
5 0
3 years ago
Read 2 more answers
John typed 545 words in 35 minutes, what is his typing speed
Katarina [22]

Answer: 545 words per 35 mins

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • If you define CSS rules on a parent control, the rules will be inherited by all of the children widgets.
    12·1 answer
  • The Spinning Jenny reduced the number of workers necessary to _______. a.remove cotton seeds from fibers b.pump water from the m
    7·1 answer
  • A server-side extension ________________. provides its services to the web server in a way that is totally transparent to the cl
    13·1 answer
  • The ____ function sums the numbers in the specified range and then divides the sum by the number of cells with numeric values in
    14·1 answer
  • Weather satellites orbit Earth at an altitude of 1,400,000 meters. What is this altitude in kilometers?
    7·1 answer
  • Match the job titles to the tasks
    11·2 answers
  • A port is the point at which a peripheral device attaches to or communicates with a computer or mobile device. True False
    15·1 answer
  • Devon would like to install a new hard drive on his computer. Because he does not have a SATA port available on his motherboard,
    7·1 answer
  • Kenny FRIEND ME. Ps that is my brother
    9·2 answers
  • What are some examples and non-examples of digital security?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!