Question: A) Write a function that accepts a train code of type character (lower or uppercase) and returns the corresponding train type according to the
A) Write a function that accepts a train code of type character (lower or uppercase) and returns the corresponding train type according to the following table: Train Code Sors Dord E or e Others Train Type Steam Diesel Electric Invalid B) Write a program that prompts the user to enter 12 train codes (char) and displays their corresponding train types by using the function defined in Part A. The Input/output of the program should be displayed as follows: Sample Input/Output: Enter 12 train codes: S This code represents Steam Train Type M This code represents Invalid Train Type d This code represents Diesel Train Type
Step by Step Solution
There are 3 Steps involved in it
Please upload the imag... View full answer
Get step-by-step solutions from verified subject matter experts
