//PROGRAM
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
//class
class travelplan
{long plancode;
char place[10];
int noofpeople;
int noofbus;
public:
travelplan();
void newplan();
void showplan();
}travel;
void travelplan::travelplan()
{cout<<"enter the plancode"<<endl;
cin>>plancode;
cout<<endl;
cout<<"enter the place"<<endl;
gets(place);
cout<<endl;
cout<<"enter the no of travellers"<<endl;
cin>>noofpeople;
cout<<endl;
}
void travelplan::newplan()
{if(noofpeople<20)
{noofbus=1;}
else if((noofpeople>=20)&&(noofpeople<40))
{noofbus=2;}
else if(noofpeople>=40)
{noofbus=3;}
}
void travelplan::showplan()
{cout<<"Plan code : "<<plancode<<endl;
cout<<"Place : ";
puts(place);
cout<<endl;
cout<<"No of travellers : "<<noofpeople<<endl;
cout<<"No of bus : "<<noofbus<<endl;
}
void main()
{travel.newplan();
travel.showplan();
getch();
}
Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]
Travel Plan ( Classes )
Click Here To Download C++ File Of This Program
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment