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
viva [34]
3 years ago
11

Design a class named QuadraticEquation for a quadratic equation ax^2+bx+x=0. The class contains: **private data fields a, b, and

c that represents three coefficients. **a constructor for the arguments for a, b, and c. **three get methods for a, b, and c. **a method named getDiscriminant() that returns the discriminant, which is b2-4ac **the methods named getRoot1() and getRoot2() for returning two roots of the equation, or returning 0 if the discriminant is negative.[/color]
Computers and Technology
1 answer:
LenaWriter [7]3 years ago
4 0

Answer:

<em>C++</em>

///////////////////////////////////////////////////////////////////////////////////////////

#include <iostream>

using namespace std;

//////////////////////////////////////////////////////////////////

class QuadraticEquation {

   int a, b, c;

   

public:

   QuadraticEquation(int a, int b, int c) {

       this->a = a;

       this->b = b;

       this->c = c;

   }

   ////////////////////////////////////////

   int getA() {

       return a;

   }

   

   int getB() {

       return b;

   }

   

   int getC() {

       return c;

   }

   ////////////////////////////////////////

   // returns the discriminant, which is b2-4ac

   int getDiscriminant() {

       return (b*2)-(4*a*c);

   }

   

   int getRoot1() {

       if (getDiscriminant() < 0)

           return 0;

       else {

           // Please specify how to calculate the two roots.

           return 1;

       }

   }

   

   int getRoot2() {

       if (getDiscriminant() < 0)

           return 0;

       else {

           // Please specify how to calculate the two roots.

           return -1;

       }

   }

};

//////////////////////////////////////////////////////////////////

int main() {

   return 0;

}

You might be interested in
​______________________ is a general security term that includes computer​ viruses, worms, and trojan horses.
VashaNatasha [74]
Malware
-------------------
6 0
3 years ago
A consumer is the name for:
hodyreva [135]

Answer:

A. a person who buys and uses products and services

7 0
3 years ago
Read 2 more answers
Andrew has data in cell E14 and the cell should be blank. Andrew should _____.
denpristay [2]
Use the mouse to click on cell E14 and press delete
4 0
3 years ago
Read 2 more answers
A diagram of a flow chart to find the average of 10 numbers​
Nat2105 [25]

Answer:

Kindly check attached picture

Explanation:

Flowchart gives a graphical representation of a steps taken towers the execution of a program.

In the flowchart attached, A variable was initialized and set to 0 ; then a for loop was used to iterate integers 1 up to 10, for each number. It is added to the initialized variable sum until all the 10 integer numbers are added. The the average is obtained by dividing by 10.

4 0
2 years ago
Describe and list advantages and disadvantages of each of the following backup types:
crimeas [40]

Answer:

Full back up

It creates complete copy of the source of data. This feature made it to the best  back  up with good speed of recovery of the data and  simplicity.However, because it  is needed for backing up  of  a lot of data, it is time consuming process,Besides it also  disturbs the routine application of  the technologist infrastructure. In addition large capacity storage is needed  for the  storage of  the large volume of back up with each new creation.

Incremental back up: back up work at high speed thus saves time, Little storage capacity is needed. This type of back up can be run as  many time as wished.

However, the restoration of data takes time, due to the time spent for restoration of initial back up and the incremental.

Differential Back up has very fast back up operation, because it only requires two pieces of back up.This is however slower compare to the Incremental.

The selective back up enable selection of certain type of file or folders for back up.

it can only be used to back up folders only when important data  are needed only.Thus the  storage capacity is low.

CPD eliminates back up window and reduces the recovery point objective.However, it has issue of compatibility with the resources to back up.,it is also expensive because its solutions are disk based.

Cloud based is affordable and save cost,It is easier to access. it is efficient,it can be access remotely for convenience.

However, Internet sources and some bandwidth must be available for access., always depends on third party providers,There is also problems encountered when switching providers.

Explanation:

8 0
3 years ago
Other questions:
  • Harry needs to use a type of graph in a spreadsheet to show variations in data over a specific period. What type of graph or cha
    11·2 answers
  • Im trying to learn c# for unity does anyone know any good sources
    10·1 answer
  • The set of instructions that directs the computer to perform a variety of tasks is known as a
    9·1 answer
  • Rachel wants to post content from digital cameras on the web. Which online tool will help Rachel to post and edit content on a w
    5·1 answer
  • landon starts his computer and gets message, hard drive is not found. He was watching a movie the previous night, what might the
    6·1 answer
  • Calvin needs to design a simple yet professional interface for his users. Which option should he implement?
    9·2 answers
  • What is the main purpose of a web crawling program
    15·1 answer
  • Which iteration must have an expression that has a true or false value?
    10·1 answer
  • When working in outline mode, press __________ and click the eye icon to change only one layer back to preview mode.
    10·1 answer
  • Explain with examples the roles of system software and application software?<br>​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!