Posts

Showing posts from September, 2017

Simple calculator using class in c++

#include <iostream> using namespace std; class calc{ int num1, num2; public:     void div()     {         int a, b;         float result;         cout<<"enter first number \n";         cin>>a;         cout<<"enter your second number \n";         cin>>b;         result=a/b;         cout<<"division done, output is : "<<result<<endl;     }      void sum()     {         int output;         cout<<"enter your first number \n";         cin>>num1;         cout<<"enter your second number \n";         cin>>num2;         output=num1+num2;         cout...

C++ for banking transaction demo

//lastbenchers.org #include <iostream> using namespace std; class transaction //declaration of class {  int amount=10000; //private data member public: //starting public function      void usercheck()     {         int user, password; // declaration of user id and password         cout<<"enter your user id \n";         cin>>user;         cout<<"enter your password \n";         cin>>password;         if(user==123456 && password==1234) // checking login details         {             //int user, password;             int choice;             cout<<"you have logged in successfully \n";             abc:            ...