I have these C++ classes:
class sales{
private:
float dollar[3];
public:
void getData(float f1,float f2, float f3){
dollar[0]=f1;// sales of first month
dollar[1]=f2;// sales of second month
dollar[2]=f3;// sales of third month
}
void putData(){
int count=0;
while(count!=3){
cout<<dollar[count]<<"\t$"<<endl;
count++;
}
}
};
class publication:public sales{
private:
string PubName;
int PubYear;
public:
void SetName(string s){
PubName=s;
}
string GetName(){
return PubName;
}
void SetYear(int y){
PubYear=y;
}
int GetYear(){
return PubYear;
}
};
class book:public publication{
private:
string Author;
public:
void SetAuthor(string a){
Author=a;
}
string GetAuthor(){
return Author;
}
};
class tape:public publication{
private:
string singer;
public:
void SetSinger(string s){
singer=s;
}
string GetSinger(){
return singer;
}
};
I would like to generate a class diagram automatically, is there online useful tool to do that?
StarUML has an reverse engineering option which will generate UML diagram based on your source code (it is free but not online). But normally you should make an diagram before writing any line of code.