Posts

CODE FOR + OPERATOR OVER LOADING C++

 PROBLEM STATEMENT: ADD 2 OBJECTS AND ADD INTO OTHER. CODE: #include<iostream> using namespace std; class Experience { private: int days; int month; double year; public: Experience() { } Experience(int a,int b,double c) { days = a; month = b; year = c; } Experience operator +(Experience E) { Experience E1; E1.days = days + E.days; E1.month = month + E.month; E1.year = year + E.year; return E1; } void display() { cout << "\nDAYS\t" << days << "\nMONTHS\t" << month << "\nYEAR\t" << year << endl; } }; int main() { Experience e1(2, 12, 2), e2(1, 12, 4), e3; e3 = e1 + e2; cout << "showing data of 1st Experience\n"; e1.display(); cout << "\n\n\n\n"; cout << "showing data of 2nd Experience\n"; e2.display(); cout << "\n\n\n\n"; cout << "showing data of sum of Experiences\

CODE FOR Function overloading C++

Image
  code: #include<iostream> using namespace std; class shapes { private: int length, width, hieght; public: shapes() { length = 0; width = 0; hieght = 0; cout << "ENTER LENGHT\nwidth\nhieght\n"; } void choice() { cout << "ENTER YOUR CHOICE\n"; cout << "R-\tAREA OF RECTANGLE\nC-\tAREA OF CIRCLE\nT-\tAREA OF TRIANGLE\n"; } void Area(int a)//area of circle { cout << "r=\t" << a << endl; cout << "AREA OF CIRCLE\t" << 2 * 3.14 * a<<endl; } void Area(int a, int b)//AREA OF RECTANGLE { cout << "LENGTH\t" << a << "\nWIDTH\t" << b<<endl; cout << "AREA OF RECTANGLE\t" << a * b; } void Area(int a, int b, int c)//triangLe { cout << "LENGTH\t" << a << "\nWIDTH\t" << b << "\nHIEGHT\t" << c &l

Employee program using nested structures in c++

Image
  CODE: #include<iostream> #include<string> using namespace std; struct Employeedata { string name; int yearofeducation; }; struct check { int experience; string DOB; int age; Employeedata d; }; int main() { check c1; cout << "ENTER YOUR DATA\nNAME\nDOB\nage\nYEAROFEDUCATION\nEXPERIENCE\n"; cin >> c1.d.name >> c1.DOB>>c1.age >> c1.d.yearofeducation >> c1.experience; cout << "checking you eligibility......................\n"; if (c1.experience < 2 && c1.d.yearofeducation > 16) { cout << "you are FRESH GRADUATE AND YOU ARE ELIGIBLE OF INTERVIEW\n"; } else if (c1.age>50 && c1.d.yearofeducation < 16) { cout << "you are not eligible for post!\n"; } else if (c1.d.yearofeducation > 18) { cout << "you are eligible for managerial position\n"; } else { cout << "pls enter valid ans

CODE FOR CAR AND BIKE MANAGEMENT USING(Virtual functions) C++

Image
  PROBLEM STATEMENT: CODE: #include<iostream> using namespace std; class mymode_of_travel { protected: int noofmiles; int price; public: virtual void store()=0 { cout << "ENTER NO OF MILES\n"; cin >> noofmiles; cout << "\nENTER PRICE\n"; cin >> price; } virtual void print()=0 { cout << "\nno of miles\t" << noofmiles << endl; cout << "\nprice\t" << price; } }; class Automobile:public mymode_of_travel { protected: string enginetype; int yearofmanufacture; int remainingwarranty;//in months public: void store() { cout << "\nENTER Engine Type\n"; cin >> enginetype; cout << "\nENTER YEAR OF MANUFACTURE\n"; cin >> yearofmanufacture; cout << "\nENTER REMAINING WARRANTY\n"; cin >> remainingwarranty; cout << "ENTER NO OF MILES\n"; cin >> noof

HOW TO DOWNLOAD GB WHATSAPP (FOR FREE)

Image
  Latest GB & Plus Blog GBWhatsApp APK Download (Updated) August 2022 Anti-Ban | OFFICIAL Nowadays, many people use WhatsApp to share videos, photos, audio, and much more. If you want to use WhatsApp with some extra features, then  GBWhatsApp APK  is available to download and install on your device. Developers modified the official WhatsApp to add some exciting features like  hidiaang Double Ticks, Change Themes, Set Online Status, Using WhatsApp Accounts,  and much more. It has extra privacy available in it, and there is no need to pay anything to use this mod. Stay with me to get more interesting information! Latest GB & Plus Blog GBWhatsApp APK Download (Updated) August 2022 Anti-Ban | OFFICIAL August 2, 2022  By  Admin   3 Comments Nowadays, many people use WhatsApp to share videos, photos, audio, and much more. If you want to use WhatsApp with some extra features, then  GBWhatsApp APK  is available to download and install on your device. Developers modified the official Wh

NESTED LOOPS IN C++

Image
 IN THIS BLOG I WILL SHOW YOU HOW TO MAKE PATTERNS USING FORLOOPS AND ALSO WE WILL SHOW YOU SYNTAX OF NESTED FOR LOOPS Nested for loops are used for many purposes in c++. nested for loops are used for making different types of shapes. Here are codes with different types of shapes: //nested for loops in c++ //lets begin #include <iostream> using namespace std; int main() {       for ( int i = 1; i <= 5; i++)       {             for ( int j = 1; j <= i; j++)             {                   cout << j;             }cout << endl;       } }   output: #include<iostream> using namespace std; int main() {                 for (int i = 5; i >= 1; i--)                 {                                 for (int j = 1; j <= i; j++)                                 {                                                 cout << j;                                 }cout << endl;                 } }