Question
main.cpp #include #include Name.h #include Date.h using namespace std; int main() { Name n; Date d; string firstname; string lastname; string middlename; int day, month,year;
main.cpp
#include
int main() { Name n; Date d; string firstname; string lastname; string middlename; int day, month,year; cout > firstname; cout > lastname; cout > middlename; cout > month; cout > day; cout > year; /.Name(firstname,lastname,middlename); n.setfirstname(firstname); n.setlastname(lastname); n.setmiddlename(middlename); d.setmonth(month); d.setday(day); d.setyear(year); cout
Name.h
// Name.h #include
using namespace std;
#ifndef Name_H #define Name_H
class Name { private: string firstname; string lastname; string middlename;
public: Name(); //default constructor Name(string fn, string ln, string mn); //constructor string getfirstname(); //accessor for the firstname string getlastname(); //accessor for the lastname string getmiddlename(); //accessor for the middlename void setfirstname(string fn); //mutator for firstname void setlastname(string ln); //mutator for lasttname void setmiddlename(string mn); //mutator for middlename };
#endif
Name.cpp
// Name.cpp
#include "Name.h" #include
using namespace std;
Name::Name() { firstname=" "; lastname=" "; middlename=" "; }
Name::Name(string fn, string ln, string mn) { firstname=fn; lastname=ln; middlename=mn; }
string Name :: getfirstname() //accessor for the firstname { return firstname; }
string Name :: getlastname() //accessor for the lastname { return lastname; }
string Name :: getmiddlename() //accessor for the middlename { return middlename; } void Name :: setfirstname(string fn) //mutator for firstname { firstname=fn; } void Name :: setlastname(string ln) //mutator for lasttname { lastname=ln; } void Name :: setmiddlename(string mn) //mutator for middlename { middlename= mn; }
Date.h
// Date.h using namespace std;
#ifndef Date_H #define Date_H
class Date { private: int month; int day; int year;
public: Date(); //default constructor Date(int m, int d, int y); //constructor int getmonth(); //accessor for the month int getday(); //accessor for the day int getyear(); //accessor for the year void setmonth(int m); //mutator for month void setyear(int d); //mutator for year void setday(int y); //mutator for month };
#endif
Date.cpp
// Date.cpp
#include "Date.h" #include
using namespace std;
Date::Date() { month=0; day=0; year=0; }
Date::Date(int m, int d, int y) { month=m; day=d; year=y; }
int Date :: getmonth() //accessor for the month { return month; }
int Date :: getday() //accessor for the day { return day; }
int Date :: getyear() //accessor for the year { return year; } void Date :: setmonth(int m) //mutator for month { month=m; if(month>12) cout31) cout2017) cout
This is the existing Name and Date class
can someone help with this please USING C++ thank u!!!
1. Create a class named ccount. 2. The class should be defined in its' own header file and have at least the following data members and member functions. Data members: accountOfficer, pointer to an object of class Name to represent the account officer who is responsible for the account. oDate, pointer to an object of class Date to represent the date that the account was opened. annualInterestRate, data member to represent the interest currently on the account. This value should be the same for all objects created. customer, an object of type Customer to represent the Customer of this account accountNumber, data member to represent the account number of the balance, data member to represent the current balance of the account Data members shared by all objects of the class activeOficer, an object of class Name to represent the current account officer who is creating accounts. cdate, an object of class Date to represent today's date. Note that this class is composed of several classes that have already been built namely Name, Date Customer. You should not need to make any changes to these classes and should set up a symbolic link to the necessary files. If you do not have working versions of these embedded classes use primitive types as data members (i.e. string to represent customer name, etc.). Feel free to add additional data members as necessary. organization and style will be taken into account to receive full credit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started