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
Shaniya has misspelled a scientific name in her biology report. She needs to correct it, but she has no access to a computer. Sh
Sav [38]

Answer:

Selection of answers:

Yes, she can navigate the window and do simple editing.

Yes, she can use this application for free and navigate the window.

No, her document is “Read-Only,” so she cannot navigate the window.

No, her application has limited features and she cannot access the document.

Answer is: No, her document is “Read-Only,” so she cannot navigate the window.

3 0
3 years ago
Tamika has received an average of 97% on all of her math tests, has done well on her homework assignments, and participates in c
sashaice [31]

Answer:

B is the correct answer.

6 0
3 years ago
Read 2 more answers
Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an ana
Andrew [12]

Answer:

Data often has intrinsic value.

Explanation:

Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an analyzing it and data often has intrinsic value.

5 0
3 years ago
And art for always texting graphics are pasted is known as
Arte-miy333 [17]
<span>A. Mechanical i think sorry if im wrong</span>
6 0
3 years ago
Read 2 more answers
Which location on the ribbon contains the commands for adding a table to a document?
Maksim231197 [3]

Adding a table to a document can be done in Microsoft Word using the insert ribbon, the insert ribbon are mostly used for adding options to a document.

  • The insert ribbon is a multi functional ribbon which has up to about 10 different useful groups for adding elements to a document.

  • Some of the groups on the insert ribbon include ; Pages, Text, Header & Footer, Tables, illustrations, Links, Media and so on.

  • The Table group in the insert ribbon allows different table adding options such as inserting an already existing table, drawing a new table or importing an excel table.

Therefore, adding a table to a document is performed from the insert ribbon in Microsoft Word.

Learn more:brainly.com/question/21842366?referrer=searchResults

4 0
2 years ago
Other questions:
  • What role do career pathways play?
    11·2 answers
  • Which of the following is NOT an ethical way of getting to the top of a web search?
    5·1 answer
  • Which of the following characters at the beginning of a cell signifies to Excel that it should perform a calculation for the val
    13·1 answer
  • What is the IEEE standard for the Wi-Fi Protected Access 2 (WPA2) security protocol?
    6·1 answer
  • Is a book considered technology?
    8·2 answers
  • You are the network administrator for Slimjim, a peripheral device company. The network uses Linux, and you need information on
    10·1 answer
  • What are the two most popular applications of theInternet?
    7·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • Audiovisual means that a presentation combines film and photos.<br> true or false?
    6·2 answers
  • The appropriate semaphore in C to give one more turn to writer so it can clean up IPC objects is WRITE_SEM. Is it true or false
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!