Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please help me. i keep getting an error in my code. I need it to be on three seperate files! attached is my

Can someone please help me. i keep getting an error in my code. I need it to be on three seperate files!
attached is my assignment and my code. c++ image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
The class date Type implements the date in a program. Write the class functions as specified in the UML class diagram. The values for the month, day, and year should be validated (in the class functions) before storing the date into the data members. Set the invalid member data to the initialization value shown in the UML. i.e. if the passed day is 38, should be set to 1. Also, if the passed day is 31 and the month is 4, this is invalid and the day should be set to 1. Add a member function, isLeapYear, to check whether a year is a leap year. Demonstrate your class in a program. date Type -dMonth: int -d Day: int -dYear: int +setDate(int, int, int) : void +getDay () const: int +getMonth() const: int +getYear() const: int +printDate() const: void +dateType (int -1, int -1, int - 1900) #ifndef DATETYPE H #define DATETYPE_H #include class DateType private: int dDay: int Month; int dYear; public: dateType(); int getDate(); int getMonth(); int getYear(); void setDate(int dDay, int dMonth, int dYear); void printDate() cout #include #include "DateType.h" using namespace std; ype.cpp -.cpp int main() DateType g; g.getDate(); g.getMonth(); g.getYear(); g.setDate(1, 1, 1900); g.printDate(); g.13LeapYear(); return 0; results X Core X B uild log xlBuild messages X Cop Checker Line wonde. 79 wonde... 26 wonde.. wonde 22 Message EROR: prototype for "void DataTypesisLeapYeart) does dot match any in ela Tort candidate is ins DateTypeTisleapYeart) In ember function "void, DateTyper peint Date() ETE"cout was not clared in this #include "DateType.h" #include DateType::dateType() dDayl; dMonth-1; dYear-1; int DateType::getDate() return dDay: 16 int DateType::getMonth() 18 return dMonth; int DateType::getYear() return dYear; void DateType::setDate(int dDay, int dMorch, int dYear) 1f (dDay >- 1 t dDay - 31 dhonth-1 1 Month

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions