Posts

C++ Self-Project traffic light program

So I will make the logical part then will write the code in C++ in a 1-week cause of college assignments

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 validate input

Image

C program for tax system

Image

C program to find sum made using while loop

Image
The output: If its needed comment below

C program to find sum made using for loop

Image
The output is: i think i will skip this one

C program to find sum of numbers 3 times

Image
The output is: