SimonsCode - time1.setDate(month day year t/call the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include "stdafx.h" # #include <iostream> # using namespace std; u class Date { public: p //constructors void setDate(int, int, int); v //functions to show date int showDay(); int showMonth(); int showYear(); i private : //variables for the class int day ; int month; int year; i }; } void main() { //declare variables int month = 0; int day =0; int year =0; i //define objects / Date time1; D //Get users input for month day and year cout << "Enter Month: "; cin >> month; c cout << "Enter Day: "; cin >> day; c cout << "Enter Year: "; cin >> year; c // send the values to the function to set the date to the time1 object
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: time1.setDate(month, day, year); t //call the functions to display the day month and year for time1 object cout << time1.showMonth() << endl; cout << time1.showDay() << endl; cout << time1.showYear() << endl; c // Pause the program / int pause = 0; cout << endl << "1 to end program\n"; cin >> pause; c } void Date::setDate(int m ,int d ,int y) { month=m; day=d; year=y; y } int Date::showMonth() { return month; r } int Date::showDay() { return day; r } int Date::showYear() { return year; r }...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

SimonsCode - time1.setDate(month day year t/call the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online