Posts

Showing posts from November, 2020

Basic Calculator

#include   <iostream> using   namespace   std ; // Function To Handle Incorrect UserInput float   checkInput ( float   input ,  string   content ) {      while  (! cin . good ())     {          cout   <<   "Wrong Input, Please Enter It Correctly \n " ;          cin . clear ();            // Clears Previous Input          cin . ignore ( 100 ,  ' \n ' );  // Ignores Wrong Input Upto 100 Characters          cout   <<   content ;          cin   >>   input ;     }    ...

Map

#include   <iostream> #include   <map> #include   <bits/stdc++.h> using   namespace   std ; class   State {      string   nameOfTheStates ;      string   popOfTheStates ;      static   int   counter ; public:      State ();  // Default Constructer      void   insert ( map < string ,  string >  & );      void   del ( map < string ,  string >  & );      void   display ( map < string ,  string >  & );      void   displayState ( map < string ,  string >  & ); }; // Function To Handle Incorrect User Input template  < typename   T > T   checkInput ( T   Input ,  string   content ) {  ...

Vector

  #include   <iostream> #include   <bits/stdc++.h> #include   <vector> using   namespace   std ; class   ItemRecord {      char   name [ 10 ];      int   quantity ;      int   code ;      float   cost ;      static   int   count ; public:      ItemRecord ();     // Default Constructer      ~ItemRecord () {}  // Destructer      void   insertDetails ( vector < ItemRecord >  & );      void   displayDetails ( vector < ItemRecord >);      void   searchDetails ( vector < ItemRecord >,  int );      void   sortDetails ( vector < ItemRecord >  & );      void   del...