C++ Self-Project traffic light program Get link Facebook X Pinterest Email Other Apps - September 18, 2018 So I will make the logical part then will write the code in C++ in a 1-week cause of college assignments Get link Facebook X Pinterest Email Other Apps Comments
C++ programming toll plaza simulation program - September 18, 2018 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); ... Read more
Comments
Post a Comment
Feel free to leave a comment...