我正在为我的C++类做一个家庭作业,但是我的重载构造函数很难.默认构造函数工作正常但重载构造函数不能正常工作.任何指导都会被批准.
/*
Name:Isis Curiel
Date:04/05/2017
Assignment 10
Instructions:
Redo assignment 5 by
1. Defining a class Date that has
(1) Three member variables:
date,
month,
year
(2) member functions
constructor: Initializes the Date to the given month, day and
year or to the default value. you can overload the constructor,
or use default arguments.
example use:
Date today(3,31, 2017); // 03/31/2017
Date firstDay; // will be 01/01/2017
reset: reset the month, day and year based on the parameters. So today.reset(4,1,2017); …Run Code Online (Sandbox Code Playgroud)