C++ Programs

Wellcome Guyz ...
  • These are the C++ Assignments and Programs.. 
  • You can easily download and watch these programs .. 



If Else Programs ;

#include <iostream.h>
#include <conio.h>
using namespace std;

int main()
{
cout<<"\n\t\t Program to show tables \n\n" ;
for(int i = 1; i <= 15; i++)
{
cout << "----Table for " << i << "----" << endl;
for(int j = 1; j <= 15; j++)
cout << i << " x " << j << " = " << i * j << endl;
}
getch ();
return 0;
}
---------------------------------------------------------------------------------------------------------------------------

#include<iostream.h>
#include<conio.h>
using namespace std;
int main ()
{
cout<<"\t \t \t!! WELCOME TO THE CAR DETAILS FRENCHISE !! "<<endl<<endl<<endl<<endl;
int monthly,loan,borrowed,interest,interestr,cost,price,downpayment,years,taxr,tax,;
cout<<" Enter The Price Of Your Car = PKR-";
cin>>price;
cout<<" Enter The Down Payment of Your Car = PKR-";
cin>>downpayment;
cout<<" Enter The Number Of Years For The Loan Of Your Car = ";
cin>>years;
taxr=(price*7)/100;
tax=price*taxr;
cout<<" The Tax Amount Of Your Car Is = PKR-"<<tax<<endl<<endl;
cost=price+tax;
cout<<" The Total Cost Of Your Car Is = PKR-"<<cost<<endl<<endl;
borrowed=cost-downpayment;
cout<<" The Borrowed Amount Of Your Car Is = PKR-"<<borrowed<<endl<<endl;
interestr=(price*9)/100;
interest=borrowed*interestr;
cout<<" The Interest Amount Of Your Car Is = PKR-"<<interest<<endl<<endl;
loan=borrowed+interest;
cout<<" The Loan Amount Of Your Car Is = PKR-"<<loan<<endl<<endl;
monthly=interest/years;
cout<<" The Monthly Payment Of Your Car Is = PKR-"<<monthly<<endl<<endl<<endl<<endl;
cout<<"\t \t!! THANKS FOR VISITING CAR DETAILS FRENCHISE !! "<<endl<<endl;
cout<<"\t \t \t \t!! MADE BY MR.AHSAN :-) !! "<<endl<<endl;
getch();
return 0;
}
---------------------------------------------------------------------------------------------------------------------------

#include <iostream.h>
#include <conio.h>
int main()
{
cout<<" \n\t\t\t!! PROGRAM TO CALCULATE DIVISIONS !! \n\n";
float eng,per,sum,DLD,EMT,CPP,CALCULUS,div;
cout<<"\nEnter the marks of DLD (100) = ";
cin>>DLD;
cout<<"\nEnter the marks of EMT (100) = ";
cin>>EMT;
cout<<"\nEnter the marks of C++ (100) = ";
cin>>CPP;
cout<<"\nEnter the marks of CALCULUS(100) = ";
cin>>CALCULUS;
cout<<"\nEnter The Marks of ENGLISH(100) = ";
cin>>eng;
sum=DLD+EMT+CPP+CALCULUS+eng;
per=sum/500*100;
cout<<"\n\n\n\t\t\t --> Your Persentage is = ";
cout<<per<<endl;
if (per>=60)
cout<<"\n\n CONGRATULATIONS U GOT 1st DIVISION :-)";
else if (per>50 && per<=59)
cout<<"\n\n CONGRATULATIONS U GOT 2nd DIVISION :-)";
else if (per>40 && per<=49)
cout<<"\n\n CONGRATULATIONS U GOT 3rd DIVISION :-)";
else if (per<40)
cout<<"\n\n YOU ARE FAIL :-( ";
cout<<"\n\n\n\t\t\t\t!! BEST OF LUCK :-)";
cout<<"\n\n\t\t\t!! MADE BY Mr.Ahsan !! \n";
getch ();
return 0;
}
---------------------------------------------------------------------------------------------------------------------------

#include<iostream.h>
#include<conio.h>
int main ()
{
cout<<"\n \t\t\t\t !! WELCOME !! \n\n";
int a,b;
cout<<"\n Enter The Marks of Physics = ";
cin>>a;
if (a>50)
{

{
cout<<"\n Enter The Marks of Chemistry = ";
cin>>b;
}
if (b>50)
{
cout<<"\n ------{ YOU R PASS :-) ";
}
else
{
cout<<"\n -------{ YOU R FAIL :-(";
}
}
else
{
cout<<"\n ------- YOU R FAIL :-(";
}
cout<<"\n\n\t\t\t !! THANKS FOR USING !! \n ";
cout<<"\n\n\t\t\t !! MADE BY MR.AHSAN !! \n ";
getch ();
return 0;
}
---------------------------------------------------------------------------------------------------------------------------

#include<iostream.h>
#include<conio.h>
using namespace std;
int main ()
{
cout<<"\t \t \t !! WELCOME TO THE PIZZA SHOP !! "<<endl<<endl;
int a,b,r;
float c=3.14,area,cost,h=0.00925,j,g;
cout<<" \t \t \t \t!! PIZZA MENU !! "<<endl<<endl;
cout<<" Price of Family size pizza (16inch) = RS-1300/-"<<endl;
cout<<" Price of Large size pizza (12inch) = RS-1000/-"<<endl;
cout<<" Price of Medium size pizza (10inch) = RS-800/-"<<endl;
cout<<" Price of Small size pizza (8inch) = RS-600/-"<<endl<<endl;
cout<<" Enter The Price Of Pizza Which U Want TO Order >> Rs-";
cin>>a;
cout<<" Enter The Diameter Of Pizza (inches) >> ";
cin>>b;
r=b/2;
area= c*(r*r)/2;
cout<<" Computed Area of Pizza Pie = "<<area<<endl<<endl;
cost=a/area;
cout<<" Cost Of Pizza Pie In (PSI)Per Square Inch is = "<<cost<<"-PSI"<<endl<<endl;
g=cost*h;
cout<<" Cost Of Pizza Pie In Dollars is = $"<<g<<endl<<endl;
j=g*100;
cout<<" Cost Of Pizza Pie In CENTS is = "<<j<<"-Cents"<<endl<<endl;
cout<<" \t \t \t!! THANKS FOR VISITING PIZZA SHOP !!"<<endl<<endl;
cout<<"\t \t \t \t !! BEST OF LUCK !!";
getch ();
return 0;
}

---------------------------------------------------------------------------------------------------------------------------
 
#include<iostream.h>
#include<conio.h>
int main ()
{
cout<<" \t \t \t!! WELCOME TO THE SALARY CALCULATOR !! "<<endl;
int a,weg,overtime,pay;
cout<<" Enter The Wage Amount >> ";
cin>>weg;
pay=weg*40;
cout<<" Your Weekly pay (weg*40) is = "<<pay<<endl;
cout<<" Your Given Standard Hourly Rate is = "<<weg<<endl;
cout<<" Enter The OverTime Hours >> ";
cin>>overtime;
a=(weg*overtime/2);
cout<<" Your Overtime Amount is = "<<a<<endl;
cout<<" Your Total Salary is = "<<pay+a<<endl;
cout<<" \t\t\t\t BEST OF LUCK :-) ";
getch ();
return 0;
}

---------------------------------------------------------------------------------------------------------------------------

 #include<iostream.h>
#include<conio.h>
int main ()
{
cout<<"\n\t\t\t!! WELCOME TO THE SLOPE CALCULATOR !! \n\n";
float x,y,xx,yy,slope;
cout<<"\nEnter The Value of Starting Point x1 = ";
cin>>x;
cout<<"\nEnter The Value of Starting Poins y1 = ";
cin>>y;
cout<<"\nEnter The Value of Ending Point x2 = ";
cin>>xx;
cout<<"\nEnter The Value of Ending Point y2 = ";
cin>>yy;
cout<<"\n Difference between Y Coordinates is Dy (y2-y1)= "<<yy-y<<endl;
cout<<"\n Difference between X Coordinates is Dx (x2-x1)= "<<xx-x<<endl;
slope=(yy-y)/(xx-x);
cout<<"\nSLOPE IS = "<<slope<<endl;
if (slope==1)
{
cout<<"\n \nLine will make the 45 degree angle with the horizon \n";
}
if (xx-x!=0)
{
if (slope<1)
{
cout<<"\nLine will travel more along X-Axis and Less along Y-Axis";
}
if (slope>1)
{
cout<<"\nLine will travel more along Y-Axis and Less along X-Axis";
}
}
if (xx-x==0)
{
cout<<"\nLine is parallel to Y-Axis";
}
if (yy-y==0)
{
cout<<"\nLine is parallel to X-Axis.\n\n";
}
cout<<"\n\n\n \t\t\t!! THANKS FOR USING !!\n\n";
cout<<"\n \t\t\t!! MADE BY MR.AHSAN !!\n\n";
getch ();
}

---------------------------------------------------------------------------------------------------------------------------

#include<iostream.h>
#include<conio.h>
int main ()
{
int table,a,c;
cout<<"Enter the Table = ";
cin>>table;
for (a=1;a<=10;a++)
{
c=table*a;
cout<<table<<"*"<<a<<"="<<c<<endl;
}
getch ();
return 0;
}

---------------------------------------------------------------------------------------------------------------------------
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment