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
What aspects of your life are most influenced by media and technology​
Anastasy [175]

Answer:

Everyday life

Explanation:

Television

office work (computers )

Music

video games

ware house work uses technology

work from home jobs use technology

cellular towers

5 0
2 years ago
Compare the two items in a summary of qualifications taken from a resumé. Which is better?
Romashka [77]

Answer:

A

Explanation:

Aptitude, is the natural yearn to carry out an objective. A just seems better.

5 0
2 years ago
Select the correct answer.
ipn [44]

Answer:

I'm guessing D? i hope its right

5 0
2 years ago
Read 2 more answers
" _____ is a measure of the amount of information that can travel from a user to the Internet in a given amount of time."
Ainat [17]

Answer:

The answer is Upload bandwidth

Explanation:

Bandwidth refers to the highest transfer rate of data on an internet connection or network.

Upload bandwidth is the amount of data that moves from a computer to the internet or a network within a given amount of time. Documents, music files, video files, software and so on can be uploaded to the internet or a network.

6 0
2 years ago
b. Suppose instead that Miller had written a routine to constantly change his assigned IP address to other addresses used by his
amm1812

Answer:

It wouldn't be legal practice of SLS’

Explanation:

The Internet service address is the address of the internet where we getting the address of the internet sometimes it is known as the computer address of the host machine.  

Since the miller has changed the Ip address continuously in a constant manner also the other address which is giving by the internet service provider  The transfer of IP address, Miller will be able to receive their network. That sort of practice is not legal of SLS.

5 0
3 years ago
Other questions:
  • When using the “reply all” option, your message will automatically be sent to ____ recipients of the original message. ​?
    7·2 answers
  • Abram was asked to explain to one of his coworkers the XOR cipher. He showed his coworker an example of adding two bits, 1 and 1
    7·1 answer
  • Internally, computers are constructed from circuitry that consists of small on/off switches. What is the most basic circuitry-le
    12·1 answer
  • The first computer (the eniac was how big
    8·1 answer
  • Which resources could be used a lot when installing a desktop app for synchronization purposes? Choose two answers.
    5·1 answer
  • What do you call an unsolicited email message that masquerades as coming from a legitimate sender, and attempts to get you to di
    11·1 answer
  • How do you activate the Formula AutoComplete function of Excel 2016?
    15·2 answers
  • I make a budget of my 1st Gamer PC its good?
    9·1 answer
  • "code is broken down by the computer until it is in _____and is a very long series of ons and offs
    11·2 answers
  • What is e banking effects
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!