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
What block(s) would most effectively keep a sprite from moving off the screen?
Sonja [21]

The block most effectively keep a sprite from moving off the screen if if on edge, bounce. Hence option B is correct.

<h3>What is screen?</h3>

Screen is defined as a portable or stationary object that offers shelter, acts as a partition, etc., and often consists of a covered frame. Screening is defined as the procedure of locating or choosing individuals from a community according to one or more selection criteria.

The block will kept more perfectly if one of the edge there is bounce so that the box will not fall from the sprite.

Thus, the block most effectively keep a sprite from moving off the screen if if on edge, bounce. Hence option B is correct.

To learn more about screen, refer to the link below:

brainly.com/question/23902291

#SPJ1

8 0
10 months ago
Does anybody know how to unlock websites from school computer
Grace [21]

Answer:

yes go to settings then apps

Explanation:

that's how I did mines

8 0
2 years ago
NumA=2<br> for count range (5,8)<br> numA=numA+count <br> print(numA)
love history [14]

Answer:

for count in range (5,8): numA=numA+count print(numA)

Explanation:

7 0
2 years ago
Which new development in malware caused sandbox technology to automate and introduce artificial intelligence learning
Karo-lina-s [1.5K]

AI-driven attacks caused sandbox technology to automate and introduce artificial intelligence learning. AI and machine learning can be used to fight against malware attacks.

<h3>Artificial intelligence, machine learning, and malware</h3>

Artificial intelligence (AI) refers to the ability of a PC to perform tasks done by humans due to the requirement of discernment.

Machine learning is a subdivision of (AI) based on the use of data and algorithms to mimic human learning.

Malware is malicious software generated by cybercriminals, which are capable of stealing unauthorized information.

Learn more about malware here:

brainly.com/question/399317

4 0
2 years ago
Select the correct answer from each drop-down menu. Computer memory stores data as a series of 0s and 1s. In computer memory, re
attashe74 [19]

Answer:

Zero (0); one (1).

Explanation:

Boolean logic refers to a theory of mathematics developed by the prominent British mathematician, called George Boole. In Boolean logic, all variables are either true or false and are denoted by the number "1" or "0" respectively; True = 1 or False = 0.

The memory of a computer generally stores data as a series of 0s and 1s. In computer memory, zero (0) represents the absence of an electric signal i.e OFF and one (1) represents the presence of an electric signal i.e ON.

4 0
3 years ago
Other questions:
  • How do humans feel about being abducted?
    12·2 answers
  • Which of the following is the MOST sensitive Personally Identifiable Information (PII) and should be shared cautiously and only
    8·1 answer
  • PLS HELP QUICKLY!!!<br> Thank you
    7·2 answers
  • Give two reasons you should be aware of your computer's system components and their characteristics.
    10·1 answer
  • Which web browser was created by Google?
    5·2 answers
  • Plzzz help i need this today :(
    15·1 answer
  • Some people recommend deleting social media accounts because of the troubling legal and ethical implications of social media. Do
    9·1 answer
  • Is the trust necessary to use an emerging technology platform? why?​
    10·1 answer
  • You have recently installed Windows Server 2019 Desktop Experience on a server. Your manager informs you that he needs to extens
    15·1 answer
  • Which of the following declares an abstract method in an abstract Java class?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!