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
The rotor in a shaded pole motor consists of
DedPeter [7]

The rotor in a shaded pole motor consists of a permanent magnet


I hope that's help:0

5 0
4 years ago
Define a function print_total_inches, with parameters num_feet and num_inches, that prints the total number of inches. Note: The
jeka94

I'll pick up your question from here:

<em>Define a function print_total_inches, with parameters num_feet and num_inches, that prints the total number of inches. Note: There are 12 inches in a foot. </em>

<em>Sample output with inputs: 5 8 </em>

<em>Total inches: 68</em>

<em />

Answer:

The program is as follows:

def print_total_inches(num_feet,num_inches):

     print("Total Inches: "+str(12 * num_feet + num_inches))

print_total_inches(5,8)

inches = int(input("Inches: "))

feet = int(input("Feet: "))

print_total_inches(feet,inches)

Explanation:

<em>This line defines the function along with the two parameters</em>

def print_total_inches(num_feet,num_inches):

<em>This line calculates and prints the equivalent number of inches</em>

     print("Total Inches: "+str(12 * num_feet + num_inches))

The main starts here:

<em>This line tests with the original arguments from the question</em>

print_total_inches(5,8)

<em>The next two lines prompts user for input (inches and feet)</em>

inches = int(input("Inches: "))

feet = int(input("Feet: "))

<em>This line prints the equivalent number of inches depending on the user input</em>

print_total_inches(feet,inches)

6 0
4 years ago
Size of a request header field exceeds server limit.
garri49 [273]
Try to Increase the value for the directive LimitRequestFieldSize in the httpd.conf:


Reason: This is normally caused by having a very large Cookie, so a request header field exceeded the limit set for Web Server.
For IBM® HTTP Server, this limit is set by LimitRequestFieldSize directive (default 8K). The LimitRequestFieldSize directive allows the Web server administrator to reduce or increase the limit on the allowed size of an HTTP request header field.
SPNEGO authentication headers can be up to 12392 bytes. This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks.

8 0
3 years ago
How does Wireshark differ from NetWitness Investigator?
nikdorinn [45]

Answer is given below

Explanation:

  • Wireshark differ from NetWitness Investigator because
  • Windshark shows a detailed view of individual packets.
  • WireShark captures live traffic and displays the results at the packet level.
  • Netwitness shows a high-level view and can be compared to the new packet capture
  • NetWitiness Investigator provides a comprehensive overview of previously tracked traffic that can be used to view anomalies, compliance and attacks.
8 0
3 years ago
Internet routing:_________. A. precomputes the most efficient route and uses it to ensure rapid packet delivery. B. broadcasts a
zvonat [6]

Answer:

<u> A. precomputes the most efficient route and uses it to ensure rapid packet delivery.</u>

Explanation:

In simple words, what Internet routing means is a process where a router decides which path data packets should follow that are more efficient in delivering the packets across computers.

For example, we can liken the process to the duties of a tour guide in a museum or large building in directing visiting guests who came to explore the museum.

7 0
3 years ago
Other questions:
  • Which tool is an easy way to navigate between rows of data in an Access table and is found in the status bar?
    9·1 answer
  • Which type of system must you connect to and use to make changes to Active Directory?
    15·1 answer
  • What item on a business card is generally the most prominent?
    10·2 answers
  • Having network users login with a username and password is an example of:
    12·1 answer
  • Professional photography is a competitive job field. <br> true <br> false
    12·2 answers
  • What should a consultant recommend to meet this requirement?Universal containers assign its contact center agents to certain int
    12·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
    6·1 answer
  • How is communication within healthcare different than communication within other industries ?
    13·1 answer
  • 5. Describe the concept behind a digital signature and explain how it relates to cybersecurity by providing a hypothetical examp
    6·1 answer
  • Not every design choice in your game interface requires having a thought process behind it.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!