C++ Assignments , Quizz And Project

Purpose of this blog is to make programming easy , weak programmers may get help from my blog i tried my best to post some of my codes in form of easiest approach, I think this blog is perfect c++ guide in form of online blog. please consult my all codes and suggest all of it with your class mates. Share experiences & knowledge with your juniors. Make yourself habitual to write different programs for 2 hours a day daily.

Tuesday, 4 December 2012

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. }

Posted by Umar Javed at 00:54
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Post Older Post Home

Follow me on

twitter
Linkedin twitter
Youtube
Facebook

About Me

Umar Javed
View my complete profile

My C++ Archieves You may Visit

  • ▼  2012 (7)
    • ▼  December (7)
      • C++ programming basics
      • simple c++ calculator program in oop
      • C++ simple vowel program ask user to enter any wor...
      • C++ CAR PARKING MANAGEMENT SYSTEM / VEHICLE MANAGE...
      • C++ Default Calculator program in Main function
      • C++ Table program can get Table of any number by a...
      • Using C++ Switch statement create the Choose Any d...
  • ►  2013 (24)
    • ►  March (15)
    • ►  April (2)
    • ►  May (1)
    • ►  June (1)
    • ►  September (1)
    • ►  October (2)
    • ►  December (2)
  • ►  2014 (10)
    • ►  February (1)
    • ►  March (4)
    • ►  June (1)
    • ►  July (1)
    • ►  October (3)
  • ►  2016 (3)
    • ►  July (1)
    • ►  September (1)
    • ►  October (1)
  • ►  2018 (2)
    • ►  July (2)
  • ►  2019 (1)
    • ►  November (1)

Popular Posts

  • 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 proje...
  • C++ GPA & CGPA Calculator Program
    You can see this program  in C# also at on another blog http://csharpisbest.blogspot.com/2013/06/c-cgpa-caclulator-form-application.html ...
  • C++ GPA CALCULATOR
    Step # 1  first you have to view my previous program that is basic C++ GPA calculator available on following link C++ GPA Calculator ...
  • C++ Car Parking Management System Complete Project Source Code
    C++ Car Parking Management System This code is written by me (c) all rights are reserved, you need permission for 3rd party content use. ...
  • 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...

Pages

  • Home
  • .NET BLOG
  • ASP.NET BLOG
  • Masm Programming
  • Follow me at Twitter
  • About Me
pay visit to my another blog csharpisbest.blogspot.com , umarjaved01@gmail.com. Simple theme. Powered by Blogger.