Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
1.2k views
in Computer by (50.9k points)
closed by

Define a class DanceAcademy in C++ with following description:

Private Members 

  • Enroll no 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:

Public Members

  • A function enrollment() to allow users to enter values for Enrollno, Name, Style and call function chkfee() to assign value of fee variable according to the Style entered by the user.
  • A function display() to allow users to view the details of all the data members.

1 Answer

+1 vote
by (45.3k points)
selected by
 
Best 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()

{

cout<<"\n Entered Enrollno is" <<"\t"<<Enrollno;

cout<<"\n Entered Name is"<<"\t"<<Name;

cout<<"\n Entered Style is:"<<<"\t"<<Style;

cout<<<"\n and Fee is : "<<"\t"<<Free;

}

};

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...