Purchase Solution

C++ Date class Inheritance and Polymorphism Program

Not what you're looking for?

Ask Custom Question

The class Date was designed to implement the date in a program, but the method setDate and the constructor with parameters do not check whether the date is valid before storing the date in the data members. Rewrite the definitions of the method setDate and the constructor with parameters so that the value of month, day, and year are checked before storing the date into the data members. Add a method isLeapYear to check whether a year is a leap year. Then write a test program to test your class

Purchase this Solution

Solution Summary

The solution contains C++ source code with class Date and the main function that contains testing code. The output looks like
*** Welcome to Date Test Program ***
Initialized date value:
1/31/2000
Set date to April 1, 2005:
4/1/2005
...and more...

The solution also contains a Java version of the program.

Solution Preview

Dear Student, please find attached the C++ source code of Date.cpp which contains the Date class and testing code in the main() function. The test results look below:

*** Welcome to Date Test Program ***
Initialized date value:
1/31/2000
Set date ...

Purchase this Solution


Free BrainMass Quizzes
Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.