Question: Write a complete bash script to print a train travel ticket. ( YOU MUST INCLUDE THE SCRIPT FILE ( . sh file ) IN THE

Write a complete bash script to print a train travel ticket.
(YOU MUST INCLUDE THE SCRIPT FILE (.sh file) IN THE ZIP)
Here are the criteria......
a. The script MUST CONTINUE in a loop until user decides to stop. User stops the ticket printing by entering 0.
b. A city offers 2 types of train services to 3 different destinations. The chart below shows the options.
The code names used for these destinations are AB,AC and AD. Code names used for the two services are E for
Express and S for standard.
c. User enters the destination (AB,AC or AD), service (E or S) and the number of people traveling.
Based on the information user entered, a ticket is printed (Just one ticket, no matter how many people traveling
in the group)
PS: If the user enters unknown options, show error messages (Look at the screen dump below)
d. Script must run a menu as follows:
New City Transit Authority - Print Your Travel Ticket
Enter Destination (AB,AC or AD.0 to quit):
Service Type (E or S):
Enter number of travelers:
Script must produce the calculated result as shown in screen dumps below:
New City Transit Authority - Print Your Travel Ticket
Enter Destination (AB,AC or AD.0 to quit): AC
Service Type (E or S): 5
Enter number of travelers: 4
New City Transit Authority - Print Your Travel Ticket
Destination : AC
Service Type : 5
Number of travelers : 4
Ticket Price 4 a.50: $38.00
New City Transit Authority - Print Your Travel Ticket
Enter Destination (AB,AC or AD.0 to quit): AD
Service Type (E or S): E
Enter number of travelers: 0
Sorry, number of travelers must be 1 or more!
New City Transit Authority - Print Your Travel Ticket
Enter Destination (AB,AC or AD,0 to quit): AP
Service Type (E or S): E
Enter number of travelers: 2
Sorry unknown Destination!
New City Transit Authority - Print Your Travel Ticket
Enter Destination (AB,AC or AD.0 to quit): AC
Service Type (E or S): D
Enter number of travelers: 1
Sorry unknown Service Type!
New City Transit Authority - Print Your Travel Ticket
Enter Destination (AB,AC or AD.0 to quit): 0
Service Type (E or S): E
Enter number of travelers: 2
Important!! Print Your Name
User entered correct values
User entered 0 for
Destination. Quit the
application
 Write a complete bash script to print a train travel ticket.

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!