Question 2 Implement a C++ class that represents a Third Degree Polynomials equation. Your class must include a default constructor, observers, mutators, equality operators and one helper functions to evaluate the equation. y=ax3+bx2+cx+d
#include <iostream>
using namespace std;
class Polynomial {
private:
double a, b, c, d;
public:
Polynomial() {}
Polynomial(double a, double b, double c, double d) : a(a), b(b), c(c), d(d) {}
double getA() {
return a;
}
void setA(double a) {
Polynomial::a = a;
}
double getB() {
return b;
}
void setB(double b) {
Polynomial::b = b;
}
double getC() {
return c;
}
void setC(double c) {
Polynomial::c = c;
}
double getD() {
return d;
}
void setD(double d) {
Polynomial::d = d;
}
Polynomial &operator=(const Polynomial &p) {
a = p.a;
b = p.b;
c = p.c;
d = p.d;
return *this;
}
double evaluate(double x) {
return a*x*x*x + b*x*x + c*x + d;
}
};
int main() {
Polynomial p(2, 3, 4, 5);
cout << "p(2) = " << p.evaluate(2) << endl;
return 0;
}

Question 2 Implement a C++ class that represents a Third Degree Polynomials equation. Your class must...
In C++: Implement a class Polynomial that uses a dynamic array of doubles to store the coefficients for a polynomial. This class does not need the method the overloaded += operator. Your class should have the following methods: Write one constructor that takes an integer n for the degree of a term and a double coefficient c for the coefficient of the term and creates the polynomial c x^n. (This constructor can be given default arguments easily to have a...
C++ NEED AS SOON AS POSSIBLE! BigInt class is used for the mathematical operations that involve very big integer calculations that are outside the limit of all available primitive data types. For example, factorial of 100 contains 158 digits in it so we can’t store it in any primitive data type available. We can store as large Integer as we want in it. Your goal is to overload the operators for a generic “BigInt” class. You will need to write...
Part 1. (60 pts) 1. Define an Address class in the file Address.h and implement the Address class in Address.cpp. a. This class should have two private data members, m_city and m_state, that are strings for storing the city name and state abbreviation for some Address b. Define and implement public getter and setter member functions for each of the two data members above. Important: since these member functions deal with objects in this case strings), ensure that your setters...
C++ In this assignment, you will write a class that implements a contact book entry. For example, my iPhone (and pretty much any smartphone) has a contacts list app that allows you to store information about your friends, colleagues, and businesses. In later assignments, you will have to implement this type of app (as a command line program, of course.) For now, you will just have to implement the building blocks for this app, namely, the Contact class. Your Contact...
3. write a c++ program: Design and implement a class called Clock that describes the time of a clock: a) Include in the class 3 constructors with one, two, and three parameters to set the hours, the minutes, and the seconds, respectively. b) Include also a default constructor that sets the member variables of the class to 00:00:00. c) Write a member function to increment the time by a given amount, and second member function to reset the clock. The...
c++
format
Goals . Understand how to implement operator overloading in C++ Warning: Programs must compile using gt+ on the Computer Science Linux systems. If your code does not compile on CS machines you will get 0 for the assignment. Organize your files into folders by lab assignment. For this assignment, create a folder called Lab9. A. Read Chapter 18 B. Create a new class called RationalNumber to represent fractions. The class should have the following capabilities: 1) It should...
2) Write a C++ program that uses a class called “Degree” to obtain the trigonometric values for angles given in degrees. This is because the trigonometric functions defined in the library file <cmath> are applied to radian angles only. Use the constant DEG2RAD = 0.017453 for conversion from degrees to radians. This class must include a constructor, destructor, and the following functions: a. void set_value(double) b. double get_value() c. double get_sine() d. double get_cosine() e. double get_tangent() f. void read_value()...
C++
Question 1) Consider a class Point that models a 2-D point with x and y coordinates. Define the class point that should have the following Private data members x and y (of type int), with default values of 0 A constant ID of type int A private static integer data member named numOfPoints This data member should be o Incremented whenever a new point object is created. o Decremented whenever a point object is destructed. A default constructor An...
It must be C++
Chapter 13 Programming Challenge 2: Employee Class.
See instruction: Chapter 13 Programming Challenge 2 Employee
Class.pdf
Program Template:
// Chapter 13, Programming Challenge 2: Employee Class
#include <iostream>
#include <string>
using namespace std;
// Employee Class Declaration
class Employee
{
private:
string name; // Employee's name
int idNumber; // ID number
string department; // Department name
string position; // Employee's position
public:
// TODO: Constructors
// TODO: Accessors
// TODO: Mutators
};
// Constructor #1
Employee::Employee(string...