Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Zoho Interview Experience

  • Difficulty Level : Expert
  • Last Updated : 11 Aug, 2021

Advance Round Programming Question(L3).

ZULO CAB APPLICATION

Create a Cab booking application, ZULA as per the details given below. The program should first present a menu with the following options

  1. Driver login
  2. Customer Login
  3. ZULA Administrator
  4. Exit

Task 1: Initialization

Initialize the data as per the details are given below to be loaded when the program starts. Note: It can be loaded and kept in the memory. No need to maintain a File or DB.

Initial Cab Drivers:

IDNAMEPASSAGE
1aaa11125
2bbb22236
3ccc33331
4ddd44428

Initial Customers:

IDNAMEPASSAGE
1WW5525
2XX6636
3YY7731
4ZZ8828

initial location

IDNAMEDISTANCE FROM ORIGIN
1A0
3C4
4D7
6F9
2B15
7G18
8H20
5R23

       

      4                3                  2                 6                3               2                   3

A——-C———-D———-F———-B———G———H———-E

Initial Cab location

LocationCabID’s
D1
G2
H3
A4

Task 2: Cab Drive/Customer Login

Cab Driver should have the option to login using existing credentials (Username and Password)

Customers should have an option to login using existing credentials (Username and Password) or create a new account with all the details.

Sample application prompt

Welcome to ZULA!!

1.Cab driver login

2.Customer login.

3.Administration login

4.Quit

Please choose a service:

Task 3: Hail a cab

The customer should be able to hail a cab based on the following conditions:

1. He/She should be able to choose the source and the destination locations. 2. The cab which is available and present in the nearest location to the source should be chosen.

3. Fare estimate should be provided to the customer. Calculated at Rs.10/km. 4. Customer should be shown a confirmation and journey initiated only if accepted.

Print the location of each cab, before booking a ride.

Sample Output:

LocationCab IDs
A3
E1
C2,4

Task 4: The following conditions have to be met for every booking.

1. The cab which is present in the nearest location to the source should be chosen.

2. The cab driver will have a mandatory rest of 1 ride after completing each ride and should not be chosen even if he is the nearest.

3. If 2 or more cabs are in the same location, the cab which has completed a fewer number of total trips should be allocated.

Task 5: ZULA Commission & Cab Driver Ride Summary

For every ride, ZULA gets a commission of 30% of the Ride Fare

The cab drivers should be able to see the complete history of their rides. The Cab Driver Name, Source, Destination, Customer Detail, Fare, and ZULA commission

Sample Output:

Cab Id: 1

Cab Driver Name: aaa

Trip Details:

Source Destinationcustomer detailZULA commissionFare
DH439130
EG21550
CB233110

Task 6: Customer Rides Summary

The Customer should be able to see the complete history of their rides. The Customer Name, Source, Destination, Cab Detail, and Fare.

Sample Output:

Customer Id: 2

Customer Name: yy

Trip Details:

Source DestinationCabDetailFare
AE3230
EG150
CB1110

Task 7: Summary of all the cabs running in ZULA available to the admin.

The admin should be able to see a summary of all the cabs which are being managed by ZULA. It should contain the Total Number of Rides, Total Fare Collected, Total ZULA Commission, Details of each trip. Sample Output

Cab Id: 1

Total Number of Trips: 3

Total Fare Collected: 290

Total ZULA Commission: 87

Trip Details:

SourceDestinationCustomer DetailFareZULA commission
DF413039
EG25015
CB211033

Cab ld: 2

Total Number of Trips: 0

Total Fare Collected: 0

Total ZULA Commission: 0

Trip Details: No trips were given

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!