Write a program that displays the following menu for Toll Plaza rates:
C- Car
B- Bus
T- Truck
The program should input the type of vehicle and display the charges for toll plaza according to the following rates:
Car = Rs. 30
Bus = Rs. 80
Truck = Rs. 100
We learn Programming to solve problems using Computers. A Computer Program is the set of instructions that are given to a computer so that it can solve problems. To solve problems is our primary goal in Computer Science.
C++ is the most fundamental language to learn programs. C++ is the High-Level Language. It is very easy to instruct computers using C++ Programming Language. My goal is to provide Practice Programs. Because As we know practice is the most fundamental aspect to learn how to program. I will provide solved programming exercises to help students.
What is Compiler?
A Compiler is computer software that is used to convert a C++ language program to a computer’s native language which is binary language. It is a translator program. It is used to convert Source Code into Object Code.
What is Source Code?
Any instruction that is written in High-Level Language i.e. C++ or C is known as Source Code.
What is Object Code?
Any Code that is written in Low-Level Language i.e. Assembly Language or Binary Language is known as Object Code.
So we will use Dev C++ Compiler for C++ Programming.
So let’s Write Code:
Write a program that displays the following menu for Toll Plaza rates:
C- Car
B- Bus
T- Truck
The program should input the type of vehicle and display the charges for toll plaza according to the following rates:
Car = Rs. 30
Bus = Rs. 80
Truck = Rs. 100
#include"iostream"
using namespace std;
main()
{
char op;
cout<<"C- Car"<<endl;
cout<<"B- Bus"<<endl;
cout<<"T- Truck"<<endl;
cout<<"Enter Your Option[C or B or T]?"<<endl;
cin>>op;
if(op == 'C')
cout<<"Toll Plaza Charges = 30 ";
else if(op == 'B')
cout<<"Toll Plaza Charges = 80 ";
else if(op == 'T')
cout<<"Toll Plaza Charges = 100 ";
}
Hope You will learn Something From Here:
We will Conver the Following topics or tags on this website.
Basic Programs In C++
C++ Coding Guideline
Class Programs In C++
Coding Convention C++ Namespace
Coding Examples C++
Coding Ground C++
Coding In C++ For Beginners
Coding In C++ Online
Coding With C++
Coding Websites C++
Complex Number Program In C++
Constructor Programs In C++
Data Structures Programs In C++
Example Programs In C++
Programs In C++ Examples
Exception Handling Programs In C++
For Loop Programs In C++
Function Overloading Programs In C++
Function Programs In C++
Game Programs In C++
Graphics Programs In C++
How To Create Programs In C++
How To Make Programs In C++
How To Write Programs In C++
Huffman Coding In C++
If Else Programs In C++
If Programs In C++
Implementation Of Stack Using Array In C++ Programs
In C++ Programs The Keyword Friend Appears In The
Inheritance Programs In C++
Interview Programs In C++
Number Pattern Programs In C++
Oops Programs In C++
Operator Overloading Programs In C++
Pattern Programs In C++
Programming In C++ Questions And Answers
Programs In C++ For Beginners
Programs In C++ Pdf
Programs In C++ Using Class
Programs In Turbo C++
Programs Of C++
Programs Of C++ Language
Writing Programs In C++
Structure Programs In C++
Template Program In C++
String Programs In C++
Stack Programs In C++
Sorting Programs In C++
Simple Programs In C++
Queue Program In C++