Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

By using c++ and the SWITCH command please help HOMEWORK #8 The Cheathem Bus Company has a rate schedule based on the number of townlines

By using c++ and the SWITCH command please help image text in transcribed
HOMEWORK #8 The Cheathem Bus Company has a rate schedule based on the number of townlines cros by a passenger as he/she rides the bus. The base rate is S0.55. This is the charge for the first town a passenger travels within. An additional charge of S0.25 is assessed for each of the first two town lines crossed. For all townlines crossed after the first two, $0.15 is charged per townline... sed Example: 1. Person X crosses 3 townlines Person X's fare will be $1.20 The breakdown is as follows: Base Rate... First 2 townlines crossed.. S0.55 S0.50 S0.15 Total Fare S1.20 Person Y crossed O t Person Y's fare will be $0.55 The breakdown is as follows: 2. ownlines. Base Rate... S0.55 Total Fare S0.55 Your assignment is to write a program to compute a passenger's fare. Your program should begin by printing a brief description of its purpose. It should then ask for and read in the number of townlines crossed by the passenger. The Cheathem busses cross a maximum of TEN townlines so the number input by the user must be an integer between 0 and 10. Your program should check for this and issue an appropriate error message when a number less than 0 or greater than 10 is issued For output your program should echo the number of townlines crossed. Echo printing merely means that your program prints out the value of the variable used to store the user's input. This allows the user to verify that the fare was computed using the correct number of townlines crossed. passenger's fare in dolla point and scientific notation SHOULD NOT BE USED !!! Your program should then compute and print out the rs and cents. There should be only two digits after the decima

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions