struct student
{
unsigned short studNum;
string name;
string course;
string yearLevel;
string section;
}
Write a program named question6c.cpp that demonstrates the use of the following functions. A C++ function named
getName()prompts the user for two string values; first name and last name and return a combination of the two as
one value. The second function getHours()calculate employee’s weekly pay, it must receive one argument,
fullName, a stringvariable and a floatvalue for the rate. It must then prompt the user for hours worked for each
day of the week, i.e. Monday – Friday and calculates the weekly pay. Employees who have worked more than 40 hours
that week will receive a bonus of 10% and those who have worked less than 40 hour will receive 10% less pay for that
week.
Use the array ADT to compute the addition and subtraction of two polynomials.
The interface of your program must look like this one:
Enter the degree of polynomial for p(x) : 5
Enter the coefficient of x^0 : 0
Enter the coefficient of x^1 : 4
Enter the coefficient of x^2 : 5
Enter the coefficient of x^3 : 0
Enter the coefficient of x^4 : 6
Enter the coefficient of x^5 : 4
Enter the degree of polynomial for q(x) : 3
Enter the coefficient of x^0 : 3
Enter the coefficient of x^1 : -2
Enter the coefficient of x^2 : 3
Enter the coefficient of x^3 : 10
First Polynomial p(x) = 4x^5 + 6x^4 + 5x^2 + 4x
Second Polynomial q(x) = 10x^3 + 3x^2 – 2x + 3
p(x) + q(x) = 4x^5 + 6x^4 +10x^3 + 8x^2 + 2x + 3
p(x) – q(x) = 4x^5 + 6x^4 – 10x^3 + 2x^2 + 6x – 3
The numbers in Red are entered by the user.
Hint:
Use 1D array to store the polynomials:
For the above example, the polynomials will be stored like this:
Index 0 1 2 3 4 5
p(x) Coefficient 0 4 5 0 6 4
Index 0 1 2 3
q(x) Coefficient 3 -2 3 10
Use the array ADT to compute the addition and subtraction of two polynomials.
The interface of your program must look like this one:
Enter the degree of polynomial for p(x) : 5
Enter the coefficient of x^0 : 0
Enter the coefficient of x^1 : 4
Enter the coefficient of x^2 : 5
Enter the coefficient of x^3 : 0
Enter the coefficient of x^4 : 6
Enter the coefficient of x^5 : 4
Enter the degree of polynomial for q(x) : 3
Enter the coefficient of x^0 : 3
Enter the coefficient of x^1 : -2
Enter the coefficient of x^2 : 3
Enter the coefficient of x^3 : 10
First Polynomial p(x) = 4x^5 + 6x^4 + 5x^2 + 4x
Second Polynomial q(x) = 10x^3 + 3x^2 – 2x + 3
p(x) + q(x) = 4x^5 + 6x^4 +10x^3 + 8x^2 + 2x + 3
p(x) – q(x) = 4x^5 + 6x^4 – 10x^3 + 2x^2 + 6x – 3
Write a function to randomly delete a node in a doubly circular link list. The return type of this function
is void, and it will not accept any parameter. Then write a main() program to test your code. Here is
the sample output of the program.
Initial doubly link list is:
40 50 10 30 65 18 72
The computer has randomly chosen node number 5 to delete
The link list after deletion of node is
40 50 10 30 18 72
given the value added tax is 15% of the cost of a product ,design an interface and write a program that accepts any cost of a product and calculates the value added tax given output
A passenger train travels at a speed of 72 km/h. A man on the passenger train observes a
goods train travelling at a speed of 54 km/h in the opposite direction. If the good train passes him in X
seconds, write a C++ function to find the length of the goods train.