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
A network engineer is troubleshooting a newly deployed wireless network that is using the latest 802.11 standards. When users ac
Lerok [7]

Answer:

it will make the wireless network faster and it is a performance network i am pretty sure.

Explanation:

5 0
3 years ago
What is Key benefit of using ram in a computer ?
photoshop1234 [79]
<span>Every computer has ram, its what starts it up, saves information and speeds up your pc, a good amount of ram is 4gbs. Hope this helps.</span>
7 0
3 years ago
Read 2 more answers
15 POINTS! please help
Maksim231197 [3]

Answer:

1. Understand your audience

2. Add a header

3. Put a face to the name

4. Write a professional headline

5. Be contactable

6. Summarize your story

7. Showcase your experience

8. Let your network speak for you

Hoped this helped

8 0
3 years ago
Read 2 more answers
You have a network with a subnet of 172.16.17.0/22. Which of the following is a valid host address?A. 172.16.17.1 255.255.255.25
Licemer1 [7]

Answer:

E. 172.16.18.255 255.255.252.0

Explanation:

Oh goodie, this is my home turf.

The answer is E) 172.16.18.255 255.255.252.0

This is because your subnet network ID includes mask \22, which means the ending with 255 255.255.252.0, which is standard for Class B. Only option E falls as an adequate host due to the network being 172.16.16 and broadcasting 16.19.

7 0
3 years ago
well im a gamer and i wait for a while befoer i accept a friend request from someone i know so i think its A
mamaluj [8]
What is your question though?
7 0
3 years ago
Other questions:
  • What's the code?
    6·1 answer
  • Given input characters for an arrowhead and arrow body, print a right-facing arrow. Ex: If the input is: *
    14·1 answer
  • vulnerability is a feebleness which allows an attacker to condense a system's information assurance to security,is it true or fa
    14·1 answer
  • A and B have same output or not? A B x=0 x=0 do do x&lt;3 x=x+1 x=x+1 print x print x while x&lt;3 while
    13·1 answer
  • What can act as a buffer against unemployment
    11·1 answer
  • All of the following are examples of being computer literate, EXCEPT ________. Group of answer choices knowing how to build and
    7·1 answer
  • Harrison works in a manufacturing unit and oversees the logistics, including the daily shipping of a large number of packages. W
    12·2 answers
  • What are other ways you could use the shake or compass code blocks in physical computing projects?
    14·1 answer
  • WHAT DO YOU KNOW?<br> Why would you want to change your Table<br> Properties?
    15·1 answer
  • I will give brainyest
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!