Define a class Dance Academy in CH with following description (2
Private Members
Enrollno of type int
• Name of type string
Style of type string
Fee of type float
A member function chkfee() to assign the value of fee variable
according to the style entered by the user according to the criteria as
given below:
Style
Fee
Classical
10000
Westem
8000
Freestyle 11000
Public Members
A function enrollment to allow users to enter values for Enrollno
Name. Style and call function chkfee to assign value of fee varsable
according to the Style entered by the user
• A function display to allow users to view the details of all the data
members
pls answer this fast
Answers
Answered by
1
Answer:
class DanceAcademy
{
int Enrollno;
char Name[15];
char Style[15];
float Fee;
void chkfee() {
if (strcmpi (Style, "Classical" )==0)
Fee=10000;
else if(strcmpi(Style,"Western")==0
Fee = 8000;
else if(strcmpi(Style, "Freestyle")=0)
Fee=11000; }
public: void enrollment()
{
cout<<"Please enter enroll no, name and style";
cin>>Enrollno>>Name>>Style;
chkfee();
}
void display() {
Explanation:
(program continuation):
cout<<"\n Entered Enrollno is" <<"\t"<Name;
cout<<"\n Entered style is"<<"\t"<<Style;
}
};
Similar questions