Need help with this c assignment There are two parts to this

Need help with this c++ assignment

There are two parts to this assignment.

Part 1

Write a program that uses a recursive function to convert a number in decimal to a given base b, where bis 2, 8, or 16. Your program should prompt the user to enter the number in decimal and the desired base.

Test your program on the following data:

9098 and base 8

692 and base 2

753 and base 16

Sample output:

Please enter a number? 4598

Please enter a base between 2 and 16? 8

The decimal number 4598 is equal to 10766 in base 8.

Please enter a number? 25354

Please enter a base between 2 and 16? 16

The decimal number 4598 is equal to 630A in base 16.

Part 2

Write a program that reads time and date of birth in numeric form such as

8-27-1980 10:56:59 pm or 8-27-1980 22:56:59.

If the time is in 12-hour notation and the date is in numeric form. The program then outputs the time in 24-hour notation and the date of birth in the form: August 27th, 1980 hh:mm:ss.

If the time is in 24-hour notation and the date is in numeric form. The program then outputs the time in 12-hour notation and the date of birth in the form: August 27th, 1980 hh:mm:ss am or pm.

Your program must contain at least 5 exception classes: InvalidHour, InvalidMinute, InvalidSec, InvalidDay, and InvalidMonth.

If an invalid value for hour, minute, second, day or month was read, then the program should throw and catch the correct matching object. Don\'t worry about the Leap Year. An example may look like this:

8-27-1980 10:56:59 pm or 8-27-1980 22:56:59.

You were born on August 27th, 1980 at 22:56:59

If invalid information was read, make sure you display a message stating that error, for example:

8-32-1980 15:61:00 am

will result into:

Invalid day:        32

Invalid hour:       15

Invalid minute:     61

Invalid timeperiod: am

Please upload the following:

The class .cpp file

The main program

The class .h file

Output File

Solution

//function call

Need help with this c++ assignment There are two parts to this assignment. Part 1 Write a program that uses a recursive function to convert a number in decimal
Need help with this c++ assignment There are two parts to this assignment. Part 1 Write a program that uses a recursive function to convert a number in decimal

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site