Popular posts from this blog
C++ programming toll plaza simulation program
So the code is; #include<iostream> using namespace std; #define Toll=10.50 #define ESC=27 class tollplaza { private: int totalcar; double totalcash; public: tollplaza() { totalcar=0; totalcash=0.0; } void payingcar() { totalcash=totalcash+Toll; totalcar=totalcar+1; } void nonpayingcar() { totalcar++; } void printcardetail() { cout<<"totalcash"; cout<<"totalcar"; } }; int main() { tollplaza plaza1; char ch; cout<<"Press 0 for no pay car\nPress 1 for pay car\nPress ESC to exit program"; do { cin>>ch; if(ch=='0') { plaza1.nonpayingcar(); } else if(ch=='1') { plaza1.printcardetail(); } } while(ch!=ESC); ...
C++ program to give you hug(pun intended)
Code: #include<iostream> using namespace std; int main() { int i , choice; cout<<"\nEnter your mood\n1.For Very good\n2.For good\n3.For avergae\n4.Bad"; cin>>i; switch(choice): { case '1': cout<<"You are being hugged"; case '2': cout<<"You are being hugged"; case '3': cout<<"Not eligible for hugs"; case '4': count<<"You need meds not hugs"; } return 0; }
Comments
Post a Comment
Feel free to leave a comment...