In int main, you should start by establishing an array of three taxi companies.
ID: 3576044 • Letter: I
Question
In int main, you should start by establishing an array of three taxi companies. The following properties should be given to each taxi company:
Name Charge per mile Charge for trip
Checker Cab 0 $30
GTS Lawrence 0.20 $5
Jayhawk Taxi 0.80 $ 1
*** function definitions
-double rateMiles stores the charge per mile
-double rateTrips stores the charge per trip (flat rate)
+Taxi(string n, double rM, double rT) constructor that sets the name, and rates
+string getName() returns the companys name
+double calculateTrip(Trip t) calculates the cost of the trip passed as argument
+double calculateCart() calculates cost of all pending orders
+void addTrip(Trip t) adds a trip to the list of orders
+void showTripx() prints the total pending cost and shows all trips
Explanation / Answer
As you are talking about this particular case of (input==2) :
Initializing is ohky . but you need an array of Taxi campany. Below is the code for that :
feel free to ask if you have any doubt :)