Write A C Program To Calculate The Parking Fare ...
Write A C Program To Calculate The Parking Fare ...
home / study / engineering / computer science / computer science questions and answers / write a c++ program to calculate the parking fare for custo…
Question: Write a C++ program to calculate the parking fare for customers… Post a question
Answers from our experts for your tough
homework questions
(3 bookmarks)
Any help with this program? Enter question
Continue to post
16 questions remaining
888-888-8888 Text me
My Textbook Solutions
Best Answer
//===========================================================================
=
// Name : Test.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//===========================================================================
=
#include <iostream>
#include <cmath>
using namespace std;
int main() {
cout<<"Type of Vehicle (C for Car, B for Bus, T for Truck): ";
cin>> type;
cout<<"Hour Vehicle enter lot(0-23)? ";
cin>> inHour;
cout<<"Minute Vehicle enter lot(0-60)? ";
cin>> inMinute;
cout<<"Hour Vehicle left lot(0-23)? ";
cin>> outHour;
cout<<"Minute Vehicle left lot(0-60)? ";
cin>> outMinute;
cout<<endl;
cout<<"PARKING LOT CHARG"<<endl;
cout<<endl;
cout<<"Type of Vehicle: ";
return 0;
}
OUTPUT:
Comment
More Answers
#include <iostream>
int main ()
char ch;
oat ph;
cin>>H1;
cin>>M1;
cin>>H2;
cin>>M2;
t1 = H1*60 + M1;
t2 = H2*60 + M2;
park = t2 - t1;
ph = park /60 ;
pm = park % 60;
if(pm>=30)
rounded_total = ph + 1;
if(ch == 'T')
cout<<"Truck";
if(ch == 'C')
cout<<"Car";
if(ch == 'B')
cout<<"Bus";
cout<<endl<<endl;
cout<<"TIME IN "<<H1<<":"<<M1<<endl;
cout<<"--------------\n\n";
if(ch == 'T')
total = rounded_total*2.0;
if(ch == 'B')
total = rounded_total*3.0;
cout<<"\n--------------\n\n";
return 0;
Q: Write a C++ program to calculate the parking fare for customers who park their cars in a parking lot when the following
information is given: a. A character showing the type of vehicle: C for car, B for bus, and T for truck. b. An integer between
0 and 24 showing the hour the vehicle entered the lot. c. An integer between 0 and 60 showing the minute the vehicle
entered the lot d. An...
Q: Write a C++ program to calculate the parking fare for customers who park their cars in a parking lot when the following
information is given: a. A character showing the type of vehicle: C for car, B for bus, and T for truck. b. An integer between
0 and 24 showing the hour the vehicle entered the lot. c. An integer between 0 and 60 showing the minute the vehicle
entered the lot d. An...
A: See answer
Show more
Q: Write a C++ program to calculate the parking fare for customers who park their cars in a parking lot when the following
information is given : a. A character showing the type of vehicle 'C' for car, 'B' for bus, 'T' for truck. b. An integer between 1
-23 showing number of hours the car was parked in the parking lot. C. An integer between 1 - 59 showing number of
minutes the car was...
Q: Write a C++ program to calculate the parking fare for customers who park their cars in a parking lot when the following
information is given: a. A character showing the type of vehicle: C for car, B for bus, and T for truck. b. An integer between
0 and 24 showing the hour the vehicle entered the lot. c. An integer between 0 and 60 showing the minute the vehicle
entered the lot d. An...
Show more
COMPANY LEGAL & POLICIES CHEGG PRODUCTS AND SERVICES CHEGG NETWORK CUSTOMER SERVICE
About Chegg Advertising Choices Cheap Textbooks Mobile Apps EasyBib Customer Service
Chegg For Good Cookie Notice Chegg Coupon Sell Textbooks Internships.com Give Us Feedback
College Marketing General Policies Chegg Play Solutions Manual Thinkful Help with eTextbooks
Corporate Development Intellectual Property Rights Chegg Study Help Study 101 Help to use EasyBib Plus
Investor Relations Terms of Use College Textbooks Textbook Rental Manage Chegg Study
Jobs Global Privacy Policy eTextbooks Used Textbooks Subscription
Join Our Affiliate Program DO NOT SELL MY INFO Flashcards Digital Access Codes Return Your Books
Media Center Honor Code Learn Chegg Money Textbook Return Policy