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
Does anyone know the code for the beaded bracelet on codehs? pls i really need help
kvv77 [185]

Answer:

Explanation:

If it has not changed since the last time that i used codehs then the code should be the following

penup()

forward(-100)

right(90)

pendown()

def beaded_bracelet():

circle(10)

penup()

forward(20)

left(10)

pendown()

for i in range(36):

beaded_bracelet()

Which should complete the entire function as intended.

6 0
2 years ago
Which of the following electronic collaboration techniques is the best
muminat

Answer:

D. project management software

6 0
2 years ago
Read 2 more answers
In the context of a manager's roles, a _____ is an informational role that involves seeking and receiving information, scanning
Marina CMI [18]

Answer: Monitor

Explanation: Monitor role is the role played by the person in the management that processes the information.The role has the responsibility of the seeking data and records of the organization.

Organizing or managing ,scanning the data that is seeked and accordingly changes are made is the function of the monitor. Monitors also examines the productivity and the processing in the management.

5 0
3 years ago
The directory "a" contains its subdirectory "b" and there is no other entry in the directory "a". You want to display "the conte
Svet_ta [14]

The answer assumes that the question is about which command help accomplish display directory contents in Unix-like operating systems.

Answer:

The command is <em>ls</em>.

Explanation:

The command <em>ls</em> (short for <em>list</em>) displays a variety of important information in different ways regarding any directory contents. Because of this, it is probably one of the most used commands in Unix-like operating systems.

Any directory can contain directories and files of different sizes, recently created/modified, attributes like permissions for being accessed, and, with this command, we can see all this information by size, chronologically, by owner, and/or by many more ways.  

In the question, we can accomplish to list that the directory "a" contains its sub-directory "b" and no other entry using the next line of code:

Command-line 1: \\ ls\; a (<em>the command "says": display content of a</em>)

Result: b

The result is only the directory <em>b </em>because there is no other entry in it.

To display more information regarding <em>b</em>, we can use the many options available for the command <em>ls</em>, like <em>-a</em> (all entries), <em>-d</em> (only directories), <em>-l</em> (long listing format), and so on, e.g. ls -a  A (display all entries in directory A, included hidden files).

6 0
3 years ago
Solid _____ is one color used throughout the entire slide.
andreev551 [17]
Solid Fill is one color used throughout the entire slide. It is possible to apply solid colors to the objects inside your slides, it may be line or fill. Usually in a powerpoint background, solid fill is used to make the presentable presentable.
7 0
2 years ago
Other questions:
  • Which step of creating a financial budget involves listing the payroll, rental, and utility costs?
    10·2 answers
  • What does the shell of an operating system do
    14·1 answer
  • Asian-American men are often represented in the media as _____.
    8·2 answers
  • Which format is best for the image below?
    12·1 answer
  • Which of the following is true of how packets are sent through the Internet?
    11·2 answers
  • Kiara is using her software's graphic formats to create a line graph. As she
    13·2 answers
  • Writing a function that implements a loop to collect a set amount of data. The function should use the serial object, the record
    9·1 answer
  • Can someone let me join your kingdom if anybody knows this game and plays it as well. ​
    13·1 answer
  • What keyword is used to declare a method in python?
    10·1 answer
  • Who is the best nfl team in your mind
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!