Monday, 6 August 2018

Combining All Programs

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<string.h>

void main()
{
   clrscr();
   int n,a,b,a1,b1,cp,sp,p,l,b3,c,d,e,f6,a6,b6,g1,h1,n3,d2,d3,r3,a9,h2,p3,p4,Ar;
   float a5,b4,g,h,x,d1,r,g2,x1,m,cm,f,i,q1,w,e1,r1,t,a7,p1,f1,c1,l1,b7,r2,ar,p2,a8,c2,p5,o,i2,u2,y,t3,g3,m2,t4,l4,P2,UL,premium;
   char a4,n2[20],grade,l3[20],n5[20],what;
   long a3,q,n1;
   label:
   gotoxy(20,1);
   cprintf("-------------------------------------------");
   gotoxy(20,2);
   cprintf("|            MENU FOR PROGRAMS            |");
   gotoxy(20,3);
   cprintf("|-----------------------------------------|");
   gotoxy(20,4);
   cprintf("|             1.) LEAP YEAR               |");
   gotoxy(20,5);
   cprintf("|             2.) ODD & EVEN              |");
   gotoxy(20,6);
   cprintf("|             3.) PROFIT & LOSS           |");
   gotoxy(20,7);
   cprintf("|             4.) REVERSE NO. EQUAL?      |");
   gotoxy(20,8);
   cprintf("|             5.) TYPE OF CHARACTER       |");
   gotoxy(20,9);
   cprintf("|             6.) STEEL METAL GRADING     |");
   gotoxy(20,10);
   cprintf("|             7.) INSAURANCE ELIGIBILITY  |");
   gotoxy(20,11);
   cprintf("|             8.) CALCULATE GROSS SALARY  |");
   gotoxy(20,12);
   cprintf("|             9.) DISTANCE B/W 2 CITIES   |");
   gotoxy(20,13);
   cprintf("|            10.) PERCENTAGE CALCULATION  |");
   gotoxy(20,14);
   cprintf("|            11.) øF TO øC                |");
   gotoxy(20,15);
   cprintf("|            12.) AREA OF RECTANGLE       |");
   gotoxy(20,16);
   cprintf("|            13.) AREAS OF DIFF. FIG.     |");
   gotoxy(20,17);
   cprintf("|            14.) GRADING OF MARKS        |");
   gotoxy(20,18);
   cprintf("|            15.) PREMIUM CALCULATION     |");
   gotoxy(20,19);
   cprintf("|          Any Other Number For CLOSING   |");
   gotoxy(20,20);
   cprintf("-------------------------------------------");
   cout<<"\n Which Program Do You Want To Enter: ";
   cin>>n;
   clrscr();
   if(n==1)
   {
     cout<<"\n Enter any year: ";
     cin>>a;
     b=a%4;
     if(b==0)
     {
     cout<<"\n The year is leap year!!";}
     else
     {
     cout<<"\n The year is not a leap year";}
     getch();
     clrscr();
     goto label;
   }
   else if(n==2)
   {
     cout<<"\n Enter any integer: ";
     cin>>a1;
     b1=a1%2;
     if(b1==0)
     {
     cout<<"\n The no. is an even no.";}
     else
     {
     cout<<"\n The no. is an odd no.";}
     getch();
     clrscr();
     goto label;
   }
   else if(n==3)
   {
     cout<<"\n Enter the Cost price: ";
     cin>>cp;
     cout<<"\n Enter the Selling Price: ";
     cin>>sp;
     if(sp>cp)
     {p=sp-cp;
     cout<<"\n You have made profit of "<<p<<"!!";}
     else
     {l=cp-sp;
     cout<<"\n You have incurred loss of "<<l;}
     getch();
     clrscr();
     goto label;
   }
   else if(n==4)
   {
     cout<<"Enter any five digit number:- ";
     cin>>a3;
     n1=a3;
     b3=a3%10;
     a3=a3/10;
     c=a3%10;
     a3=a3/10;
     d=a3%10;
     a3=a3/10;
     e=a3%10;
     a3=a3/10;
     f6=a3%10;
     a3=a3/10;
     q=(b3*10000.0)+(c*1000.0)+(d*100.0)+(e*10.0)+f6;
     cout<<"\n The reverse number is:- "<<q;
     if(n1==q)
     {cout<<"\n The no. and its reverse are equal";}
     else
     {
     cout<<"\n The no. and its reverse are unqual";}
     getch();
     clrscr();
     goto label;
   }
   else if(n==5)
   {
     cout<<"\n Enter any character: ";
     cin>>a4;
     if(a4>=65 && a4<=90)
     {
     cout<<"\n The character is a capital letter";}
     else if(a4>=97 && a4<=122)
     {
     cout<<"\n The character is a small case letter";}
     else if(a4>=48 && a4<=57)
     {cout<<"\n The character is a digit";}
     else
     {cout<<"\n The character is a special character";}
     getch();
     clrscr();
     goto label;
   }
   else if(n==6)
   {
     cout<<"\n Grading of Steel Metal:- \n Enter The hardness of the steel: ";
     cin>>a5;
     cout<<"\n Enter Carbon content in steel: ";
     cin>>b4;
     cout<<"\n Enter the Tensile Strength: ";
     cin>>g;
     if(a5>=50 && b4<=0.7 && g>=5600)
     {cout<<"\n Your Steel has got GRADE 10!!!";}
     else if(a5>=50 && b4<=0.7 && g<5600)
     {cout<<"\n Your Steel has got GRADE 9!!";}
     else if(a5<50 && b4<=0.7 && g>=5600)
     {cout<<"\n Your Steel has got GRADE 8!";}
     else if(a5>=50 && b4>0.7 && g>=5600)
     {cout<<"\n Your Steel has got GRADE 7";}
     else if(a5>=50 && b4>0.7 && g<5600 || a5<50 && b4<=0.7 && g<5600 || a5<50 && b4>0.7 && g>=5600)
     {cout<<"\n Your Steel has got GRADE 6";}
     else if(a5<50 && b4>0.7 && g<5600)
     {cout<<"\n Your Steel has got GRADE 5";}
     else
     {cout<<"\n Your Steel has very low quality with grade less than 5";}
     getch();
     clrscr();
     goto label;
   }
   else if(n==7)
   {
     cout<<"\n Enter your name: ";
     cin>>n2;
     cout<<"\n Enter your age: ";
     cin>>a6;
     cout<<"\n Where do you live?(1-City & 2-Village): ";
     cin>>b6;
     cout<<"\n Enter your Gender(1-Male & 2-Female): ";
     cin>>g1;
     cout<<"\n Are you healthy?(1-Yes & 2-No): ";
     cin>>h1;
     if(a6>=25 && a6<=35 && b6==1 && g1==1 && h1==1)
     {cout<<n1<<"\n You have to pay Rs.4 per thousand and your policy amount cannot exceed Rs.2 lakhs";}
     else if(a6>=25 && a6<=35 && b6==1 && g1==2 && h1==1)
     {cout<<n1<<"\n You have to pay Rs.3 per thousand and your policy amount cannot exceed Rs.1 lakhs";}
     else if(a6>=25 && a6<=35 && b6==2 && g1==1 && h1==2)
     {cout<<n1<<"\n You have to pay Rs.6 per thousand and your policy amount cannot exceed Rs.10000";}
     else
     {cout<<"\n You are not eligible for insaurance";  }
     getch();
     clrscr();
     goto label;
   }
   else if(n==8)
   {
     cout<<"Enter your basic salary:- ";
     cin>>x;
     d1=(0.4)*x;
     r=(0.2)*x;
     g2=(x+d+r);
     cout<<"\n Your Gross salary isÆ "<<g2;
     getch();
     clrscr();
     goto label;
   }
   else if(n==9)
   {
     cout<<"Enter the distance between any two cities(in km):- ";
     cin>>x1;
     m=x1*(1000);
     cm=m*(100);
     f=(30.48)*cm;
     i=(2.54)*cm;
     cout<<"\n The distance in metre isÆ "<<m;
     cout<<"\n The distance in centimetre isÆ "<<cm;
     cout<<"\n The distance in feet isÆ "<<f;
     cout<<"\n The distance in inches isÆ "<<i;
     getch();
     clrscr();
     goto label;
   }
   else if(n==10)
   {
     cout<<"Enter your marks in 1st sub. :-  ";
     cin>>q1;
     cout<<"Enter your marks in 2nd sub. :-  ";
     cin>>w;
     cout<<"Enter your marks in 3rd sub. :-  ";
     cin>>e1;
     cout<<"Enter your marks in 4th sub. :-  ";
     cin>>r1;
     cout<<"Enter your marks in 5th sub. :-  ";
     cin>>t;
     a7=(q1+w+e1+r1+t)/5;
     p1=a7;
     cout<<"\n The Aggregate marks is Æ "<<a7;
     cout<<"\n The Percentage marks isÆ "<<p1<<"%";
     getch();
     clrscr();
     goto label;
   }
   else if(n==11)
   {
     cout<<"Enter Temperature in farenheit :-  ";
     cin>>f1;
     c1=((0.55)*f1+32);
     cout<<"\n The Temperature in centigrade isÆ "<<c1;
     getch();
     clrscr();
     goto label;
   }
   else if(n==12)
   {
     cout<<"Enter length and breadth of a rectangle:- ";
     cin>>l1>>b7;
     ar=l1*b7;
     p2=2*(l1+b7);
     cout<<"\n The Area of rectangle isÆ "<<ar<<"\n The perimetre of rectangle isÆ "<<p2<<"\n\n Enter the radius of any circleÆ ";
     cin>>r2;
     a8=3.14*r2*r2;
     c2=2*3.14*r2;
     cout<<"\n The area of the circle isÆ "<<a8<<"\n The circumference of circle isÆ "<<c2;
     getch();
     clrscr();
     goto label;
   }
   else if(n==13)
   {
     clrscr();
     cout<<"\nQ)Want To Find Area??";
     cout<<"\n  Circle[1]";
     cout<<"\n  Trapezium[2]";
     cout<<"\n  Rhombus[3]";
     cout<<"\n  Square[4]";
     cout<<"\n\nWhat type of fig. are you finding:-";
     cin>>n3;
     switch(n3)
     {
     case 1:
     cout<<"\n   Enter Radius of Circle: ";
     cin>>r3;
     Ar=3.14*pow(r3,2);
     cout<<"\n   Area= "<<Ar; break;
     case 2:
     cout<<"\n   Enter Height: ";
     cin>>h2;
     cout<<"\n   Enter Parallel sides: ";
     cin>>p3>>p4;
     Ar=0.5*h2*(p3+p4);
     cout<<"\n   Area= "<<Ar; break;
     case 3:
     cout<<"\n   Enter Diagonals: ";
     cin>>d2>>d3;
     Ar=0.5*d2*d3;
     cout<<"\n   Area= "<<Ar; break;
     case 4:
     cout<<"\n   Enter Side: ";
     cin>>a9;
     Ar=pow(a9,2);
     cout<<"\n   Area= "<<Ar; break;
     default: cout<<"Wrong input!!!!";
     }
     getch();
     clrscr();
     goto label;
   }
   else if(n==14)
   {
     cout<<"Enter Your NAME: ";
     cin>>l3;
     cout<<"\n Enter marks of Maths (out of 100) : ";
     cin>>p5;
     cout<<"\n Enter marks of English (out of 100) : ";
     cin>>o;
     cout<<"\n Enter marks of Sanskrit (out of 100) : ";
     cin>>i2;
     cout<<"\n Enter marks of Science (out of 100) : ";
     cin>>u2;
     cout<<"\n Enter marks of Social Science (out of 100) : ";
     cin>>y;
     t3=(p5+o+i2+u2+y)/5;
     if(t3>0 && t3<=30)
     {grade='F';
     cout<<"\n"<<l3<<" sorry you are Fail!!!! go study";}
     else if(t3>30 && t3<=60)
     {grade='E';
     cout<<"\n"<<l3<<" your grade is \"E\" need to work hard";}
     else if(t3>60 && t3<=70)
     {grade='D';
     cout<<"\n"<<l3<<" your grade is \"D\" go home and get lost";}
     else if(t3>70 && t3<=80)
     {grade='C';
     cout<<"\n"<<l3<<" your grade is \"C\" go home and get lost";}
     else if(t3>80 && t3<=90)
     {grade='B';
     cout<<"\n"<<l3<<" your grade is \"B\" go home and get lost";}
     else if(t3>90 && t3<=100)
     {grade='A';
     cout<<"\n"<<l3<<" your grade is \"A!!\" ";}
     else
     {
     cout<<"\nWrong Input";}
     switch(grade)
     {
     case 'A': cout<<"\n"<<l3<<" you are eligible for Art"; break;
     case 'B': cout<<"\n"<<l3<<" you are eligible for Commerce"; break;
     case 'C': cout<<"\n"<<l3<<" you are eligible for Dance"; break;
     case 'D': cout<<"\n"<<l3<<" you are eligible for Majduri"; break;
     case 'E': cout<<"\n"<<l3<<" you are eligible for Kheti"; break;
     case 'F': cout<<"\n"<<l3<<" you are eligible for Nothing"; break;
     default : cout<<"....";
     }
     getch();
     clrscr();
     goto label;
   }
   else if(n==15)
   {
     cout<<"LIC Premium Calculator:-";
     cout<<"\n  Enter Your Name: ";
     cin>>n5;
     cout<<"\n  Gender:- \n       ¯Male [1]\n       ¯Female [2]\n   >Enter Gender: ";
     cin>>g3;
     cout<<"\n  Enter Amount of Maturity: ";
     cin>>m2;
     cout<<"\n  Enter Tine Period (in Months): ";
     cin>>t4;
     cout<<"\n  Select Living area:-";
     cout<<"\n       ¯City [1]";
     cout<<"\n       ¯Village [2]";
     cout<<"\n       ¯Capital(Mumbai, Delhi, Kolkata, Chennai) [3]";
     cout<<"\n   >Enter Your Living Area: ";
     cin>>l4;
     P2=m2/(pow(1+0.0850,t4));
     if(g3==1)
     {
if(l4==1)
UL=500000;
else if(l4==2)
UL=150000;
else if(l4==3)
UL=1000000;
     }
     else if(g3==2)
     {
if(l4==1)
UL=400000;
else if(l4==2)
UL=60000;
else if(l4==3)
UL=800000;
     }
     premium=P2/t4+(P2*0.18)/t4;
     if(premium>=UL)
     cout<<"\n"<<n5<<" Your Premium is: "<<premium;
     else
     cout<<"\n"<<n5<<" You are not eligible for Premium";
     getch();
     clrscr();
     goto label;
    }
     else
    {
     cout<<"\nWRONG INPUT!!!\n WANT TO TRY AGAIN? [Y-yes, N-no]:\n";
     cin>>what;
     if(what=='Y')
     goto label;
     else if(what=='N')
     cout<<"\nTHANK YOU";
     getch();
    }
}




===========================================================================


                                OUTPUT


No comments:

Post a Comment