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
kirill115 [55]
4 years ago
12

Write the definition of a function named quadratic that receives three double parameters a, b, c. If the value of a is 0 then th

e function prints the message "no solution for a=0" and returns. If the value of "b squared" – 4ac is negative, then the code prints out the message "no real solutions" and returns. Otherwise the function prints out the largest solution to the quadratic equation.
Computers and Technology
1 answer:
VMariaS [17]4 years ago
5 0

Answer:

#include <iostream>

#include <cmath>

using namespace std;

//initialize function quadratic

void quadratic(double, double, double);

int main() {

   //declare double variables a, b and c

   double a,b,c;

   //take input from user

   cin>>a>>b>>c;

   //call function quadratic

   quadratic(a,b,c);

return 0;

}

void quadratic(double a, double b, double  c){

   double root,n;

   //check if variable a is equal to zero

   if(a==0){

       cout<<"no solution for a=0"<<endl;

       return;

   }

   //check if b squared - 4ac is less than zero

   else

   if(((b*b)-(4*a*c))<0){

       cout<<"no real solutions"<<endl;

       return;

   }

   //print the largest root if the above conditions are not satisfied

   else{

       n=((b*b)-(4*a*c));

       root=(-b + sqrt(n)) / (2*a);

       cout<<"Largest root is:"<<root<<endl;

   }

   return ;

}

Explanation:

Read three double variables a, b and c from the user and pass it to the function quadratic. Check if the value of variable a is equal to zero. If true, print "no solution for a=0". If this condition is false, check if b squared - 4ac is less than zero. If true, print "no real solutions". If this condition is also false, calculate the largest solution using the following formula:

largest root = (-b + square root of (b squared - 4ac)) / (2*a)

Input 1:

2 5 3

Output 2:

Largest root is:-1

Input 2:

5 6 1

Output 2:

Largest root is:-0.2

You might be interested in
B. Find Addition of Binary Numbers: 1100112 + 11012
schepotkina [342]
Hello, I assume you mean 110011_2 + 1101_2

To add 110011+ 1101 we can setup the problem like the following:

   110011
+     1101 
-------------
  1000000

When we add 1 + 1 this equals 10 so we just carry the 1 and we keep doing that from right to left. Also 1 + 0 = 1 

7 0
3 years ago
What is the full form of 'Rom<br>​
Nuetrik [128]

Answer:

Read-only memory

Explanation:

Read-only memory is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device.

3 0
3 years ago
Read 2 more answers
Time management is the ability to use time effectively.
denis-greek [22]

Answer:

True

Explanation:

if you are able to manage time well, then that means you have good time management skills

3 0
3 years ago
Read 2 more answers
. What is a "secondary dimension" in Google Analytics?
a_sh-v [17]

Answer:

c.<em> An additional dimension you can add to a report for more specific analysis.</em>

Explanation:

The correct option is <em>c. An additional dimension you can add to a report for more specific analysis. </em>

By definition and according to Google Analytics support, “<em>The Secondary Dimension feature allows you to define a primary dimension and then view that data by a secondary dimension within the same table</em>."

It means that the secondary dimension provides a better understanding of data being analyzed.

3 0
3 years ago
Another method that might be desired is one that updates the Goalie's jerseyNumber. This method will receive a new number of Jer
irina [24]

Answer:

A setter method

Explanation:

A setter method will accomplish this. A setter method is a method that takes in a value as an argument and grabs an object's instance variable and modifies it with the value passed as an argument. In this scenario, the argument value would be the current JerseyNumber. The setter method will grab the object's jerseyNumber variable and change its value to be the value of the passed argument. Setter methods are common practice in all object classes as well as the getter methods to retrieve instance variables.

4 0
3 years ago
Other questions:
  • The variable sentence stores a string. Write code to determine how many words in sentence start and end with the same letter, in
    13·1 answer
  • When the word “computer” was coined, what did it mean?
    12·1 answer
  • The information gathering technique that enables the analyst to collect facts and opinions from a wide range of geographically d
    11·1 answer
  • 1. Which of the following is a drone? (1 point)
    10·1 answer
  • Toshiba Corporation makes computer chips. Toshiba Corporation would be classified as a A. merchandising company. B. manufacturin
    15·1 answer
  • What type of link is used to call this file shown below?
    5·1 answer
  • Which type of device often controls IoT tasks?<br> Desktop<br> Laptop<br> Smartphone<br> Switch
    8·1 answer
  • Love me love me say that u love me fool me fool me go on and fool me : ) answer the question thx
    6·2 answers
  • Please help me with this this is Computer chapter Advanced HTML of class 8th​
    10·1 answer
  • I will give brainyest
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!