Construct a polynomial class (Polynom) to represent polynomials of the form
P=a0+a1x+a2x^2+….+anx^n. Request:
Polynomials with dynamic memory management to hold coefficients (int bac; double *heso)
The coefficients of a polynomial of type double
It is possible to declare a polynomial with a given number of degrees, given array of coefficients.
By default, the polynomial has degree n=0, the coefficients are set to the initial value 0.0 except the last coefficient of order n is 1.0.
Defining the destructor
Has a copy constructor
Polynomial assignment can be performed using the = . sign
Write a main program using the above classSimple programming problem that is solvable using vector.
What can be used instead of scanf and print f and the text written inside such as %2d. Knowing that we are only allowed to use math. H library. And we have only done else if statements, switch statements, for while loops and 1d 2d arrays.
with a custom method called displayVehicle() that displays the details of a vehicle as follows:
If the vehicle is available then it should display the details of a vehicle as the values of the instance variables vehicleID and dailyRate only
Otherwise, if the vehicle is currently on loan it should display the name and license number of the person holding the car as well as the number of days it was rented out. (this obvious includes details above.)
There is only one kind of manager in the EMPMULT program in inheritance chapter. Any serious
company has executives as well as managers. From the manager class derive a class
called executive. (We’ll assume an executive is a high-end kind of manager.) The additional data in the executive class will be the size of the employee’s yearly bonus and the
number of shares of company stock held in his or her stock-option plan. Add the appropriate
member functions so these data items can be input and displayed along with the other
manager data.
Derive a class called employee2 from the employee class in the EMPLOY program in this
chapter. This new class should add a type double data item called compensation, and
also an enum type called period to indicate whether the employee is paid hourly, weekly,
or monthly. For simplicity you can change the manager, scientist, and laborer classes
so they are derived from employee2 instead of employee. However, note that in many
circumstances it might be more in the spirit of OOP to create a separate base class called
compensation and three new classes manager2, scientist2, and laborer2, and use
multiple inheritance to derive these three classes from the original manager, scientist,
and laborer classes and from compensation. This way none of the original classes
needs to be modified.
Start with the publication, book, and tape classes. Add a base class sales
that holds an array of three floats so that it can record the dollar sales of a particular
publication for the last three months. Include a getdata() function to get three sales
amounts from the user, and a putdata() function to display the sales figures. Alter the
book and tape classes so they are derived from both publication and sales. An object
of class book or tape should input and output sales data along with its other data. Write
a main() function to create a book object and a tape object and exercise their input/output
capabilities.
Imagine a publishing company that markets both book and audiocassette versions of its
works. Create a class publication that stores the title (a string) and price (type float)
of a publication. From this class derive two classes: book, which adds a page count (type
int), and tape, which adds a playing time in minutes (type float). Each of these three
classes should have a getdata() function to get its data from the user at the keyboard,
and a putdata() function to display its data.
Write a main() program to test the book and tape classes by creating instances of them,
asking the user to fill in data with getdata(), and then displaying the data with putdata().
A bank is providing loan to its customers. Customers will return back loan with installments without any INTEREST but penalty charges are needed to be paid.
Fine Rs. 100 per day will be charged if amount is paid after due date and 5% penalty will be charged on Due amount if pay less amount. write c++ code using arrays. only math.h lib can be used if needed.
part 2:
Add 2-Dimensional array along with the one dimension array used in Question-1. Display the results in tabular form after entering data using 2-Dimensional array
Write a main function that will create 5 Vehicle objects using the data below. Assume all the Vehicles are available initially.
Vehicle ID Daily-Rates ($)
FJH 123N 12.0
DKY 222N 25.0
GAF 333N 18.0
BGH 444N 40.0
FRS 555N 30.0