Плз решите эту проблему
write the definition of a class photo in c++ with following description private members pno //data member of photo number an integer category //data member for photo category a string exhibit //data member for exhibition gallery (a string) fixexhibit //a member function to assign //exhibition gallery is per category //as shown in the following table category exhibit antique zaveri modern johsen classic terenida public members Register() a function to allow user to enter values //pno, category and call fixexhibit () function view all() // a function to display all the data members.
Что я уже пробовал:
#include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> class pic { int pno; char Category[50]; char location[50]; void fixlocation(); public: void enter(); void seeall(); }; void pic::fixlocation() { if(strcmpi(Category,"classic")==0) strcpy(location,"Amina"); else if(strcmpi(Category,"Modren")==0) strcpy(location,"Jim Plag"); else if(strcmpi(Category,"Antique")==0) strcpy(location,"ustad khan"); } void pic::enter() { cin>>pno; gets(Category); //fixlocaton(); } void pic::seeall() { cout<<pno<<Category<<location<<endl; }; void main() { clrscr(); pic h; h.enter(); getch(); }