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
How to write a survey on cat theory​
nalin [4]
Start with a bold statement then follow with facts solutions problems and theory’s
3 0
2 years ago
How do is excel interpret data?
juin [17]

Explanation:

Once a spreadsheet has a data set stored within its cells, you can process the data. Excel cells can contain functions, formulas and references to other cells that allow you to glean insights in existing data sets, for example by performing calculations on them.

4 0
3 years ago
There are a number of types of digital memory available, such as hard disk drive (HDD), random access memory (RAM), solid state
elena55 [62]

Answer and Explanation:

In my view, there is no benefit to having several types of digital storage, but it would be helpful when there is only single SSD format of different sizes, therefore it would be very convenient for an individual to select storage memory and doesn't get frustrated although several choices contribute to uncertainty about what to purchase rather than what is better for the machine. So, only a single centralized memory and the only one that is deemed perfect for your device so far.

(a)...Yeah, then it'll be easier and even more efficient for individuals to have a single standard because there'd be only that standard and then no more ambiguity, although it is quicker or lighter and would have been sufficient to send.

(b)...No, I wouldn't be using the very same piece of hardware if I were considering multiple processing categories because I would require memory interface types for various functions, so those won't all require the very same memory, however, I would like various storage of various sizes and I'm using memory interface categories effectively.

6 0
3 years ago
Is The answers the computer givesback​
Ivanshal [37]

Answer:

i think so if you have a question?????

Explanation:

diablo ka

8 0
2 years ago
Think of an aspect of HTML that you found challenging to master. Why is that aspect of HTML important? What are some future situ
Lunna [17]

Answer:

html is a thing that u can to create an website business that u can make money on it

7 0
3 years ago
Other questions:
  • Helppppppppppppppppppp
    11·1 answer
  • How did tafts accomplishments regarding conservation and trust-busting compare to roosevelt?
    11·1 answer
  • While the Internet can be a great resource, the information is not always reliable, as anyone can post information. Select one:
    11·1 answer
  • The _____ handles the instructions for your computer to start up before the operating system is loaded.
    10·1 answer
  • A technician has been dispatched to a customer site to diagnose an issue where the computer turns off intermittently. Upon arriv
    11·1 answer
  • Which view allows you to make changes to the content of your presentation?
    13·1 answer
  • Which of these is not a way of avoiding email fraud and scams?
    6·1 answer
  • Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This
    14·1 answer
  • I need help 50 points and brainiest if you answer
    10·2 answers
  • IVD. IIIcelTICISTUSTUSE LIICIULUI 1.12. Which of the two systems do you think will need the largest motor? Explain your answer.​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!