x.Hmust write a constructor function for your class thatinitializes the data mem
ID: 3615559 • Letter: X
Question
x.Hmust write a constructor function for your class thatinitializes the data members. You must write a destructor function for yourclass that cleans up any allocated space such as the name. You must write adisplay function for your class that prints out all the activity data that isincluded in an object. Please it's okay if you can only do the first two tasks, thanks. I don't know how to initialize constructor using an array object, hope some one help me4 88 11.30 a 10/10 L 10.00 45 The Big Event
8 120 6.00 p 10/9 S 15.00 40 Oozeball
490 34 12.30 p 10/12 V 25.00 40 Society of Women Engineers
130 32 11.30 a 8/10 F 10.00 30 Joint Council of Eng. Organs.
132 43 12.00 p 10/13 P 15.00 55 Freshman Leaders on Campus
134 18 1.00 p 10/19 M 5.00 45 National Society of Black engs.
135 90 9.00 a 11/14 C 4.00 40 Society of Professional Engs.
170 91 10.00 p 10/11 F 6.00 35 Biomedical Eng. Student Society
512 15 9.30 a 12/12 C 15.00 40 Concert choir
140 36 12.00 p 10/15 L 5.00 45 Assoc. for Computing Machinery
141 45 2.30 p 10/21 V 15.00 58 Game Developer's Club
#include<fstream>
#include<iostream>
#include<string>
#include<cstdlib>
//#include "cpp.h"
#define GROUPMAX 50
using namespace std;
class Activities
{
public:
void setgroupNum(int num);
void setgroupSize(int size);
void setgroupTime(float time);
void setgrouphfDay(char hfday);
void setgroupMonth(int month);
void setgroupDay(int day);
void setgroupPurpose(char pose);
void setgroupCost(float cost);
void setgroupLength(int len);
void setgroupName(char name[]);
int getgroupNum();
char * getgroupName();
float getmeetTime();
char gethalfDay();
int getmeetMonth();
int getmeetDay();
char getgroupPurpose();
int getgroupSize();
float getgroupCost();
int getmeetLength();
private:
int groupnum;
char *groupname;
float meettime;
char mthalfday;
int nextmonth;
int nextday;
char purpose;
int groupsize;
float groupcost;
int meetlength;
};
void Activities::setgroupNum(int num)
{
groupnum = num;
}
void Activities::setgroupSize(int size)
{
groupsize = size;
}
void Activities::setgroupTime(float time)
{
meettime = time;
}
void Activities::setgrouphfDay(char hfday)
{
mthalfday = hfday;
}
void Activities::setgroupMonth(int month)
{
nextmonth = month;
}
void Activities::setgroupDay(int day)
{
nextday = day;
}
void Activities::setgroupPurpose(char pose)
{
purpose = pose;
}
void Activities::setgroupCost(float cost)
{
groupcost = cost;
}
void Activities::setgroupLength(int len)
{
meetlength = len;
}
void Activities::setgroupName(char name[])
{
groupname = new char[strlen(name) + 1];
strcpy(groupname, name);
}
int Activities::getgroupNum()
{
return groupnum;
}
int Activities::getgroupSize()
{
return groupsize;
}
int Activities::getmeetMonth()
{
return nextmonth;
}
int Activities::getmeetDay()
{
return nextday;
}
int Activities::getmeetLength()
{
return meetlength;
}
float Activities::getmeetTime()
{
return meettime;
}
float Activities::getgroupCost()
{
return groupcost;
}
char Activities::gethalfDay()
{
return mthalfday;
}
char Activities::getgroupPurpose()
{
return purpose;
}
char * Activities::getgroupName()
{
return groupname;
}
void printallinput(Activities fungroup[], int xindex);
void searchmeettime(Activities fungroup[], int xindex);
int main(void)
{
Activities TAorg[GROUPMAX];
int i, index = 0, intro;
int old, mnum, msize;
int mmonth, mday, mlen;
float mcost, mtime;
const int MAX = 100;
char mhalf, namestr[MAX];
char mpose;
int choose;
int meettemp;
cout << " Welcome to Campus Activities system; also known as CAS.";
cout << " ----------------------------------------------------------- ";
cout << " As a student, there are lot of activitiesthat will benefit every student, so this program helps students ";
cout << "learn about activities such as sports, fun club, volunteer organization, etc. groups ";
cout << "that they might want to get involved in. ";
cout << "Please press 1 to view the various exciting activity programs on campus >>>
Explanation / Answer
x.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.