Learn C++ in step-by-step lessons.
Date Class: Using a class
In this lesson you will use a Date class. Using the Date class and looking at the code will help you to understand what is involved when you write your own classes.
Goals:
- To understand and use a class
Objectives:
Please study the material at each of the links below.
Getting date from system clock
Leap year explanation
Starting the Date class
Discussing the Date class- The Date class
Test the Date class- Create the Date class
Date methods
Constructors- Class methods: toString
Better methods- Invalid dates
- Comparing dates
- The + operator
- The day of the week
Glossary for date lesson
Full Glossary