You are on page 1of 1

EXP4_1 #include<iostream.h> #include<conio.

h> class mb { public: float cc,avg; char brand[10]; void accept() { cout<<"\nEnter brand of the motor bike: " ; cin>>brand; cout<<"\nEnter the cc of motor bike: "; cin>>cc; cout<<"\nEnter the average distance for one litre offered"; cin>>avg; } void display() { cout<<"\nBrand of the motor bike: " <<brand; cout<<"\nCC of motor bike: "<<cc; cout<<"\nAverage distance for one litre offered"<<avg; } }; void main() { int i; clrscr(); mb a[5]; for(i=0;i<5;i++) { cout<<"\nEnter the details for motor bike "<<i+1<<endl; a[i].accept(); } cout<<"\nDetails : "; for(i=0;i<5;i++) { cout<<endl<<"Motor bike : "<<i+1<<endl; a[i].display(); } getch(); }

Page 1

Print to PDF without this message by purchasing novaPDF (