Question: Write a program in c# that Emulate a simple long-distance bus service reservation system. We are dealing with a handful of routes each with a

Write a program in c# that

Emulate a simple long-distance bus service reservation system.

We are dealing with a handful of routes each with a number of daily running buses, each with a specified number of seats.

Each customer that buys a ticket will get an assigned seat.

Invalid reservation will result in an exception. Here is a possible list (you might want to come up with a hierarchy of these exceptions): counter is closed, seats are not available, service is cancelled, insufficient funds to purchase, payment gateway is not responding.

Create unit tests instead of a demo app.

--------------------------------------------------------------

Create collections or lists of relevant objects.

Bus Company has Routes Routes have Buses Buses have Seats with each seat having a status (occupied or free)

Customer has at least payment information. TicketPurchase can be a method in a separate Transactions object, where you pass Route or Bus and Customer payment information.

You can emulate exceptions by setting flags in the Transactions objects.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!