Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program that prompts the user to enter a person’s date of birth in numeric form such as 8-27-1980. The program then outputs the date of birth in the form: August 27, 1980. Your program must contain at least two exception classes: invalidDay and invalidMonth. If the user enters an invalid value for day, then the program should throw and catch an invalidDay object. Follow similar conventions for the invalid values of month and year. (Note that your program must handle a leap year.)


Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must contain three exception classes: invalidHr, invalidMin, and invalidSec. If the user enters an invalid value for hours, then the program should throw and catch an invalidHr object. Follow similar conventions for the invalid values of minutes and seconds.


Write a program that prompts the user to enter a length in feet and then enter a length in inches and outputs the equivalent length in centimeters. If the user enters a negative number or a non-digit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers.


Your error message should read A non positive number is entered and allow the user to try again.


Format your output with setprecision(2) to ensure the proper number of decimals for testing!


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


Write a main function that declares two rectangle object as follows:
The first name rect1 is created using the overridden default constructor.
The second named rect2 has a height of 5 and width of 10 assigned by the parameterized constructor.
Use setWidth and setHeight to assign rect1 a width of 100 and height of 25 respectively.
Call computeArea and computePerimeter for each rectangle object.
Call getArea and getPerimeter and display the area and perimeter of each rectangle.

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


LATEST TUTORIALS
APPROVED BY CLIENTS