c++ doubt

plzz help!!

create a workshop registration program that registers a student by taking details.ensure that no student register twice.Have a separate class for area of interest(area_id,workshop,publication details...etc).use friend function to add area(sub area)for student.(note two areas cant be added under same workdone)display student details and area of interest he/she added.

Thanx in advance.
closed account (48T7M4Gy)
What do you want help with?
plz help me wid the class design
Last edited on
closed account (48T7M4Gy)
Which class? Pick a name for it - start somewhere :)
class student
{
string regno;
string name;
aoi a;
public:
void getdetails();
// void check();
void display();
friend void addarea(student);
};

class aoi
{
string area_id;
string workdone;
string pub_details;
public:
void addarea(student);
void checkcriteria();
};


is this ok?
Last edited on
closed account (48T7M4Gy)
use code tags and indents. What's an aoi? Must be AreaOfInterest.
Last edited on
yaa its areaOfInterest
closed account (48T7M4Gy)
OK concentrate on the student class. You need a constructor, destructor, int IDNo and private properties string name and two methods getID() and getName(). Do AreaOfInterest class later.
closed account (48T7M4Gy)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Student{
private:
   int IDNo;
   string Name;
 
public:
Student( int id, string name ) {
      IDNo= id;
      Name = name;
   }

  ~Student()
  {
  }
 
   string getName() {
      return Name;
   }
 
   int getID() {
      return IDNo;
   }
};
thnx..and do i need to pass object of one class into another?
closed account (48T7M4Gy)
Well, the short answer is yes but you should think about AreaOfInterest. Hint: get the basics of that right first. Use the Student class as a pattern.
how about this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class aoi
{
	string area_id;
	string workdone;
	string publiction;
	public:
		aoi(string area,string wd,string pub)
		{
			area_id=area;
			workdone=wd;
			publication=pub;
		}
		
		~aoi()
		{
		}
		
		string getareaid(student)
		return area_id;
}
Last edited on
Topic archived. No new replies allowed.