hello, i hope you all doing well.i have this part of code but when i try to choose 2 then get to per then go inside loop dosent let me put the date when i put 0 and even the commant too , please help me with it !
class bor:public ani {
subscript sub ;
public:
void bor()
{
int ch;
cout << "\n\nChoose your Subscription : " << endl;
cout << " 1.premium "<<endl;
cout << " 2.basic "<<endl;
cout << " 3.Log in to a new Subscription " <<endl;
cin >> ch;
switch(ch)
{
case 1: pre();
break;
case 2: bas();
break;
case 3: sub.add_Subscription();
break;
}
void pre(){
string name;
int chose;
string comm;
int day,month,year;
int arrynormal[3];
cout << "Welcome to premium Subscription system \n please enter the name of your animal : " <<endl;
cin >> name;
sub.setSubscription(name);
cout << "Dear : "<<sub.getSubscription()<<endl;
do {
cout << "If you want borrow an animal press 1, if you are not press 0 " <<endl;
cin>>chose;
switch (chose) {
case 0: cout<< "Thank you Dear " <<endl;
break;
case 1:
for ( int i=0; i<3; ){
{cout << "Enter the ID of the Animal you want to borrow : " <<endl;
cin >> arrynormal[i];
}
cout << "If you want onther animal press 1, if you are not press 0 " <<endl;
cin >> chose;
if ( chose==1 )
i++;
elsebreak;
}
{cout<<"pleas enter the date should be (DD/MM/YYYY):"<<endl;
cin>>day>>month>>year;
cout<<"enter the comment:"<<endl;
cin>>comm;
cout<<" If you want print you informaion press 1, if you are not press 0"<<endl;
if ( chose==1 ){
for ( int i=0; i<3; ){
{cout<<"the animal:"<< arrynormal[i];
cout<<"the date:"<<day<<"/"<<month<<"/"<<year<<endl;
}
}elsebreak;
}
}
}while( chose!=0 );
}
class bor:public ani {
subscript sub ;
public:
void bor()
{
int ch;
cout << "\n\nChoose your Subscription : " << endl;
cout << " 1.premium "<<endl;
cout << " 2.basic "<<endl;
cout << " 3.Log in to a new Subscription " <<endl;
cin >> ch;
switch(ch)
{
case 1: pre();
break;
case 2: bas();
break;
case 3: sub.add_Subscription();
break;
}
void pre(){
string name;
int chose;
string comm;
int day,month,year;
int arrynormal[3];
cout << "Welcome to premium Subscription system \n please enter the name of your animal : " <<endl;
cin >> name;
sub.setSubscription(name);
cout << "Dear : "<<sub.getSubscription()<<endl;
do {
cout << "If you want borrow an animal press 1, if you are not press 0 " <<endl;
cin>>chose;
switch (chose)
{
case 0: cout<< "Thank you Dear " <<endl;
break;
case 1:
for ( int i=0; i<3; ){
{cout << "Enter the ID of the Animal you want to borrow : " <<endl;
cin >> arrynormal[i];
}
cout << "If you want onther animal press 1, if you are not press 0 " <<endl;
cin >> chose;
if ( chose==1 )
i++;
elsebreak;
}
{
cout<<"pleas enter the date should be (DD/MM/YYYY):"<<endl;
cin>>day>>month>>year;
cout<<"enter the comment:"<<endl;
cin>>comm;
cout<<" If you want print you informaion press 1, if you are not press 0"<<endl;
if ( chose==1 ){
for ( int i=0; i<3; ){
{cout<<"the animal:"<< arrynormal[i];
cout<<"the date:"<<day<<"/"<<month<<"/"<<year<<endl;
}
}elsebreak;
}
}
}while( chose!=0 );
}
How does this even compile?
there is no main-function and you only posted part of your code.
Furthermore: that function stops in the middle of nowhere :o