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]
4 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]4 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
What is one advantage of a wireless network? Wireless networks provide faster data transfer speeds than wired networks. Wireless
tiny-mole [99]
People can access the internet from many locations within the wireless area
6 0
3 years ago
Read 2 more answers
Write a program in pascal to find the area of a circle
umka2103 [35]

Program Area_Circle;

Uses Crt;

Const

Pi = 3.1416;

Var

Radius : Integer;

Area : Real;

Begin

Clrscr;

Writeln('Area of a Circle Solver');

Writeln;

Write('Enter the Radius of the Circle : ');

Readln(Radius);

Area := (Pi * Radius * Radius);

Writeln;

Writeln('The Area of the Circle is ' ,Area:8:2,'.');

Writeln;

Writeln('Program Executed');

Readln;

End.

Hope this helps!

5 0
4 years ago
what is the difference between the registry and server manager in reference to its management/configuration ?
Ksivusya [100]

Explanation:

Server manager perform various types management tasks in Microsoft window to manage remote severs without require any physical access. It enable remote desktop connection protocols. It basically use server manager for manage the server remotely.

Registry is very important as it store essential information about the window system and about its configurations. It is mainly use in Microsoft window for operating its system and applications. It also store low level settings in the system.

6 0
3 years ago
Given the declaration
STALIN [3.7K]

Answer:

False

Explanation:

There's only one component of the array list which is list[0] which has value 50

7 0
4 years ago
What is a collection of records DBMS?
murzikaleks [220]

Answer:Database

Explanation:

- is an integrated collection of logically related records or files. A database consolidates records previously stored in separate files into a common pool of data records that provides data for many applications. The data is managed by systems software called database management systems (DBMS).

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is the best overall approach to education and career development for IT professionals?
    14·1 answer
  • Alcatel-Lucent’s High Leverage Network (HLN) increases bandwidth and network capabilities while reducing the negative impact on
    6·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • What is the least number of options you should come up with to help you solve a problem?
    15·1 answer
  • You are an IT technician for a small computer store. You are designing a new gaming PC for a customer. You need to ensure that i
    12·1 answer
  • Ellen's laptop has a built-in 802.11n-capable wireless NIC. The wireless NIC worked perfectly yesterday when she loaned it to he
    12·1 answer
  • Install hardware, install software, and convert data are the three steps found in the _____. Select one:
    14·1 answer
  • Help me to write spaghetti stack function, please!!
    11·1 answer
  • Programs which were typically reserved for college-level classes such as computer animation and CAD programs are now being appli
    13·1 answer
  • How can edge computing be used to increase sustainability
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!