//factorial of an given number
//by:- aniketkoli183@gamil.com
//visit here :- https://jerryindia.home.blog/
#include<iostream>
using namespace std;
int fact(int size)
{
int temp=1;
for(int i=1;i<=size;i++)
{
temp*=i;
}
cout<<temp;
}
int main()
{
int size;
cout<<"Enter number to calculate factorail := ";
cin>>size;
fact(size);
return 0;
}
//program by:- aniketkoli183@gmail.com
//visit here for more code:- https://jerryindia.home.blog/
#include<iostream>
#include<string>
#define max 10
using namespace std;
class automobile
{
//private:
public:
//protected:
string name;
bool two1,three1,four1;
int count2;
int count3;
int count4;
public:
automobile()
{
count2=0;
count3=0;
count4=0;
}
int getdata()
{
cout<<"\nyour are in factory ";
cout<<"\nEnter company name : ";
cin>>name;
cout<<"\nproduction of two wheeler ? [1:yes] [0:no] ";
cin>>two1;
cout<<"\nproduction of three wheeler ? [1:yes] [0:no] ";
cin>>three1;
cout<<"\nproduction of four wheeler ? [1:yes] [0:no] ";
cin>>four1;
}
};
class two : virtual public automobile
{
protected:
string modname[max];
int avg[max],gear[max],price[max],qty2[max];
public:
int getdetails()
{
cout<<"\nyour are in 2 chaki";
cout<<"\nEnter model name : ";
cin>>modname[count2];
cout<<"\nEnter net average : ";
cin>>avg[count2];
cout<<"\nEnter price of "<<modname[count2]<<" : ";
cin>>price[count2];
cout<<"\nTotal production of "<<modname[count2]<<" : ";
cin>>qty2[count2];
count2++;
}
int display2()
{
cout<<"\n\n...........WELCOME TO FACTORY MANAGEMENT TWO WHEELER SECTION...........\n\n";
cout<<"Model Name\tNet Avg\tPrice\tProduction\n";
cout<<count2;
for(int i=0;i<count2;i++)
{
cout<<modname[i]<<"\t\t"<<avg[i]<<"\t\t"<<price[i]<<"\t\t"<<qty2[i]<<endl;
}
}
};
class four : virtual public automobile
{
protected:
string modname1[max];
int avg1[max],gear1[max],price1[max];
int capacity1[max],qty4[max];
public:
int get()
{
cout<<"\nyour are in 4 chaki";
cout<<"\nEnter model name : ";
cin>>modname1[count4];
cout<<"\nEnter net average : ";
cin>>avg1[count4];
cout<<"\nEnter price of "<<modname1[count4]<<" : ";
cin>>price1[count4];
cout<<"\nEnter Fuel capacity of "<<modname1[count4]<<" : ";
cin>>capacity1[count4];
cout<<"\nTotal production of "<<modname1[count4]<<" : ";
cin>>qty4[count4];
count4++;
}
int display4()
{
cout<<"\n\n...........WELCOME TO FACTORY MANAGEMENT FOUR WHEELER SECTION...........\n\n";
cout<<"Model Name\tNet Avg\tPrice\tCapacity\tProduction\n";
for(int i=0;i<count4;i++)
{
cout<<modname1[i]<<"\t\t"<<avg1[i]<<"\t\t"<<price1[i]<<"\t\t"<<capacity1[i]<<"\t\t"<<qty4[i]<<endl;
}
}
};
class three: virtual public automobile
{
protected:
string modname2[max];
int avg2[max],gear2[max],price2[max];
int capacity2[max],qty3[max];
bool vahtuk[max];
public:
int collect()
{
cout<<"\nyour are in 3 chaki";
cout<<"\nEnter model name : ";
cin>>modname2[count3];
cout<<"\nEnter net average : ";
cin>>avg2[count3];
cout<<"\nEnter price of "<<modname2[count3]<<" : ";
cin>>price2[count3];
cout<<"\nEnter capacity of "<<modname2[count3]<<" : ";
cin>>capacity2[count3];
cout<<"\nVehicle of type "<<modname2[count3]<<" [1:public ] [0:goods] : ";
cin>>vahtuk[count3];
cout<<"\nTotal production of "<<modname2[count3]<<" : ";
cin>>qty3[count3];
count3++;
}
int display3()
{
cout<<"\n\n...........WELCOME TO FACTORY MANAGEMENT THREE WHEELER SECTION...........\n\n";
cout<<"Model Name\tNet Avg\tPrice\tCapacity\tType\tProduction\n";
for(int i=0;i<count3;i++)
{
cout<<modname2[i]<<"\t\t"<<avg2[i]<<"\t\t"<<price2[i]<<"\t\t"<<capacity2[i]<<"\t\t"<<vahtuk[i]<<"\t\t"<<qty3[i]<<endl;
}
}
};
class records:public two, public three, public four
{
public:
int display()
{
cout<<"\n\n_________________WELCOME TO FACTORY MANAGEMENT_________________\n\n";
cout<<"Name of Company := "<<name<<"\n";
if(two1==1)
{
display2();
}
else
{
cout<<"\n\nPRODUCTION FOR TWO WHEELERS NOT FOUND ACCORDING TO OUR RECORD......\n\n";
}
if(three1==1)
{
display3();
}
else
{
cout<<"\n\nPRODUCTION FOR THREE WHEELERS NOT FOUND ACCORDING TO OUR RECORD......\n\n";
}
if(four1==1)
{
display4();
}
else
{
cout<<"\n\nPRODUCTION FOR FOUR WHEELERS NOT FOUND ACCORDING TO OUR RECORD......\n\n";
}
}
};
int main()
{
records r1[3];
string cnme;
cout<<"\n\nENTR DATA FOR THREE COMPANIES......";
for(int i=0;i<3;i++)
{
r1[i].getdata();
}
while(true)
{
cout<<"\n\n1. SEPARATE ENQUIRY \n2. NET DISPLAY ENQUIRY \n3. PRESS Ctrl+C TO EXIT FROM SYSTEM \nEnter your choice :=";
int choice;
cin>>choice;
switch(choice)
{
case 1:
cout<<"\nEnter company name := ";
cin>>cnme;
for(int i=0;i<3;i++)
{
if(r1[i].name==cnme)
{
int p=1;
while(p!=0)
{
cout<<"\n\n1. ADD ENTRY \n2. SEPARATE DISPLAY ENQUIRY \n3. COMPANY DISPLAY ENQUIRY \n4. EXIT \nEnter your choice :=";
int cho;
cin>>cho;
switch(cho)
{
case 1:
cout<<"1. two wheeler\n2.three wheeler\n3.four wheeler";
int opt1;
cin>>opt1;
if(opt1==1)
{
if(r1[i].two1==1)
{
r1[i].getdetails();
}
else
{
cout<<"\n\according to database two wheeler production not selected...";
}
}
if(opt1==2)
{
if(r1[i].three1==1)
{
r1[i].collect();
}
else
{
cout<<"\n\according to database three wheeler production not selected...";
}
}
if(opt1==3)
{
if(r1[i].four1==1)
{
r1[i].get();
}
else
{
cout<<"\n\according to database four wheeler production not selected...";
}
}
break;
case 2:
cout<<"1. two wheeler\n2.three wheeler\n3.four wheeler";
int opt;
cin>>opt;
if(opt==1)
{
if(r1[i].two1==1)
{
r1[i].display2();
}
else
{
cout<<"\n\according to database two wheeler production not selected...";
}
}
if(opt==2)
{
if(r1[i].three1==1)
{
r1[i].display3();
}
else
{
cout<<"\n\according to database three wheeler production not selected...";
}
}
if(opt==3)
{
if(r1[i].four1==1)
{
r1[i].display4();
}
else
{
cout<<"\n\according to database four wheeler production not selected...";
}
}
break;
case 3:
r1[i].display();
cout<<"\n..............................................................";
r1[i].display();
cout<<"\n..............................................................";
r1[i].display();
break;
case 4:
p=0;
break;
default:
cout<<"\n\nINVALID SELECTION.....";
break;
}
}
}
}
break;
case 2:
for(int i=0;i<3;i++)
{
r1[i].display();
}
break;
default:
cout<<"\n\nINVALID SELECTION.....";
break;
}
}
return 0;
}