Monday 10 December 2012

Using C++ Switch statement create the Choose Any deal Program in MC DONALD

#include<iostream.h>
#include<conio.h>
void main()
{int opt;
cout<<"mc donal counter program"<<endl<<endl;
cout<<"-----Select Any One Deal-----"<<endl;
cout<<"1--- pepsi with french fries 100RS "<<endl;
cout<<"2--- pepsi with double fish flish 295RS "<<endl;
cout<<"3--- pepsi with cheese buger 190RS "<<endl;
cout<<"4--- pepsi with chiken burger 21RS "<<endl;
cout<<"5--- pepsi with zinger burger 250RS "<<endl;
cin>>opt;
switch(opt)
{
    case 1:
        gotoxy(15,14);
        cout<<"You have selected Deal number = "<<opt<<endl;
        gotoxy(20,17);
        cout<<"--------Reciept--------"<<endl;
        gotoxy(13,18);
        cout<<"choosed pepsi with french fries for RS 100 "<<endl;
        gotoxy(28,19);
        cout<<"thank You"<<endl;
        break;
    case 2:
        gotoxy(15,14);
        cout<<"You have selected Deal number = "<<opt<<endl;
        gotoxy(20,17);
        cout<<"--------Reciept--------"<<endl;
        gotoxy(13,18);
        cout<<"choosed pepsi with double fish flish for RS 295 "<<endl;
        gotoxy(28,19);
        cout<<"thank You"<<endl;
        break;
    case 3:
        gotoxy(15,14);
        cout<<"You have selected Deal number = "<<opt<<endl;
        gotoxy(20,17);
        cout<<"--------Reciept--------"<<endl;
        gotoxy(13,18);
        cout<<"choosed pepsi with cheese buger 190RS "<<endl;
        gotoxy(28,19);
        cout<<"thank You"<<endl;
        break;
    case 4:
        gotoxy(15,14);        cout<<"You have selected Deal number = "<<opt<<endl;


        gotoxy(20,17);
        cout<<"--------Reciept--------"<<endl;
        gotoxy(13,18);
        cout<<"choosed pepsi with chiken burger 215RS "<<endl;
        gotoxy(28,19);
        cout<<"thank You"<<endl;
        break;
    case 5:
        gotoxy(15,14);
        cout<<"You have selected Deal number = "<<opt<<endl;
        gotoxy(20,17);
        cout<<"--------Reciept--------"<<endl;
        gotoxy(13,18);
        cout<<"choosed pepsi with zinger burger 250RS "<<endl;
        gotoxy(28,19);
        cout<<"thank You"<<endl;
        break;

}
getch();
}

Thursday 6 December 2012

C++ Table program can get Table of any number by again and again input the value


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

void main()
{
int inpt;
char ch;
do
{
gotoxy(15,7);
cout<<"please enter the number for the table to generate= ";
cin>>inpt;
int a=31,b=10;
gotoxy(25,9);
cout<<"xxxxxxxxxxxxxxxxxxxxxxx";
for(int x=1;x<=10;x++)
{int total;
gotoxy(a,b);
total=x*inpt;
cout<<inpt<<" X "<<x<<" = "<<total;
b++;
}
gotoxy(25,20);
cout<<"xxxxxxxxxxxxxxxxxxxxxxx";
gotoxy(32,22);
cout<<"Thank you"<<endl;
gotoxy(20,24);
cout<<"want another table please enter number above table"<<endl;
}while(ch='c');
getch();
}

Wednesday 5 December 2012

C++ Default Calculator program in Main function

#include<iostream.h>
#include<conio.h>
void main()
{
    int a=2;
    int b=3;

    gotoxy(26,15);
    cout<<"Add = "<<a+b;
    gotoxy(26,16);
  cout<<"sub = "<<a-b;
  gotoxy(26,17);
  cout<<"mult = "<<a*b;
  gotoxy(25,18);
  cout<<"divide = "<<a/b;





getch();

}

Tuesday 4 December 2012

C++ CAR PARKING MANAGEMENT SYSTEM / VEHICLE MANAGEMENT SYSTEM


CAR PARKING PROGRAM / VEHICLE MANAGEMENT SYSTEM


OUT PUT OF CAR PARKING PROGRAM

Remember this is basic C++ program limited project for complete solution of C++ project means advance coded project you must visit this posted latest program

C++ Car Parking Management System Complete Project


  1.  //cf program to calculate the ticket of the car parking
  2. //programmer name umar javed
  3. //umarjaved01@gmail.com
  4. //14-05-2011

  5. #include<iostream.h>
  6. #include<cstring.h>
  7. int main()
  8. {
  9. //programminisbest.blogspot.com
  10. int nic_num;
  11. int n;
  12. int price;
  13. char name[15];
  14. char fname[15];

  15. cout<<"Welcome to the car parking system program"<<endl;
  16. cout<<"Please Enter the Required Informations for car parking"<<endl;
  17. cout<<"_______________________________________"<<endl;
  18. cout<<"enter the name = ";
  19. cin>>name;
  20. cout<<"enter the father name = ";
  21. cin>>fname;
  22. //programminisbest.blogspot.com
  23. cout<<endl<<"plz enter the ur nic number"<<endl;
  24. cin>>nic_num;

  25. cout<<"choose which pakage u want to park the car"<<endl<<"1 for 2hrs"<<endl<<"2 for 4 hrz"<<endl<<"3 for 6 hrz"<<endl<<"4 for 8 hrz"<<endl;
  26. cin>>n;

  27. switch(n)
  28. {
  29. case 1:
  30. {
  31. cout<<"you have choose the pakage no 1"<<endl;
  32. cout<<"car is parked for 2 hours";
  33. price=12*2;
  34. cout<<endl<<"price of ticket"<<"="<<price<<"RS"<<endl;
  35. break;
  36. }

  37. //programminisbest.blogspot.com
  38. case 2:
  39. {cout<<"you have choose the pakage no 2"<<endl;
  40. cout<<"car is parked for 4 hours";
  41. price=12*4;
  42. cout<<endl<<"price of ticket"<<"="<<price<<"RS"<<endl;
  43. break;
  44. }

  45. case 3:
  46. {
  47. cout<<"you have choose the pakage no 3"<<endl;
  48. cout<<"car is parked for 6 hours";
  49. price=12*6;
  50. cout<<endl<<"price of ticket"<<"="<<price<<"RS"<<endl;
  51. break;
  52. }

  53. case 4:
  54. {
  55. cout<<"you have choose the pakage no 4"<<endl;
  56. cout<<"car is parked for 8 hours";
  57. price=12*8;
  58. cout<<endl<<"price of ticket"<<"="<<price<<"RS"<<endl;
  59. break;
  60. }



  61. default:
  62. {
  63. cout<<"no package is here the choice u entered"<<endl<<"try agian"<<endl;
  64. }

  65. }
  66. cout<<"thank you for using our services"<<endl;
  67. cout<<"................................";
  68. //programminisbest.blogspot.com
  69. cout<<endl<endl;
  70. cout<<endl<<endl<<".....R.E.C.I.P.T....."<<endl;
  71. cout<<endl<<"Your name is ="<<name;
  72. cout<<endl<<"Your father name is ="<<fname<<endl;
  73. cout<<"Your Nic number is = "<<nic_num<<endl;
  74. cout<<"Package You choosed is number = "<<n<<endl;
  75. cout<<"-----------------------------------------"<<endl;
  76. cout<<"thank you for using our parking service"<<endl;
  77. cout<<"-----------------------------------------"<<endl;
  78. //programminisbest.blogspot.com

  79. return 0; }
  80. //programminisbest.blogspot.com

C++ simple vowel program ask user to enter any word if he/she enter vowel then compiler would answer you

#include<iostream.h>
#include<conio.h>
void main()
{
char ch;
gotoxy(32,4);
cout<<"programmer umar javed";
gotoxy(27,6);
cout<<"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
gotoxy(18,8);
cout<<"please enter any character to check whether vowel or not ";
gotoxy(43,10);
cin>>ch;
gotoxy(25,12);
if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u')
cout<<"enter character = "<<ch<<" is found a Vowel"<<endl;
else
cout<<"sorry enter character = "<<ch<<" is not a vowel"<<endl;
gotoxy(27,14);
cout<<"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
getch();
}

simple c++ calculator program in oop

  1. #include<iostream.h>
  2. #include<conio.h>

  3. class C
  4. {
  5. private:
  6. int x,y;
  7. public:
  8. void show(int a,int b)
  9. {
  10. gotoxy(28,15);
  11. cout<<"sum = "<<a+b;
  12. gotoxy(28,16);
  13. cout<<"sub = "<<a-b;
  14. gotoxy(28,17);
  15. cout<<"Mult = "<<a*b;
  16. gotoxy(28,18);
  17. cout<<"div = "<<a/b;
  18. gotoxy(28,20);
  19. cout<<"total = "<<((a+b)+(a-b)+(a*b)+(a/b));
  20. gotoxy(28,21);
  21. cout<<"total Average = "<<(((a+b)+(a-b)+(a*b)+(a/b))/2);
  22. }

  23. void show1(int w,int v)
  24. {
  25. gotoxy(1,15);
  26. cout<<"sum = "<<w+v;
  27. gotoxy(1,16);
  28. cout<<"suv = "<<w-v;
  29. gotoxy(1,17);
  30. cout<<"Mult = "<<w*v;
  31. gotoxy(1,18);
  32. cout<<"div = "<<w/v;
  33. gotoxy(1,20);
  34. cout<<"total = "<<((w+v)+(w-v)+(w*v)+(w/v));
  35. gotoxy(1,21);
  36. cout<<"total averwge = "<<(((w+v)+(w-v)+(w*v)+(w/v))/2);


  37. }

  38. };

  39. void main()
  40. {
  41. C l;
  42. l.show(2,3);
  43. int j,k;
  44. gotoxy(10,1);
  45. cout<<"please input 2 numbers for perform = "<<endl;
  46. cin>>j>>k;
  47. l.show1(j,k);
  48. getch();
  49. }

Monday 3 December 2012

C++ programming basics

C++ programming basics are as under

starts with header file

#include<>

and include means to attach some thing what the location of what?

#include<iostream.h>

give the compiler a reference to istream file that's it

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

#include<iostream.h>

#include<conio.h>


you are thinking what is conio?


conio.h is that header file to give the compiler a instruction that to control the input and output of the sources in the code.


void main(){ }
structure body of c++ where the program create and develop its logic which is understanded by compiler and excute it


just like that


#include<iostream.h>


#include<conio.h>


void main()
{
cout<<"hello";
 }




compiler just show hello as output


i hope you like my c++ basic tutorial


for more visit my facebook id: www.facebook.com/umf01