Quantcast
Channel: :: UOB-BH :: منتديات طلبة جامعة البحرين
Viewing all articles
Browse latest Browse all 4542

سؤال في ال cs 111

$
0
0
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 Train Type
S or s Steam
D or d Diesel
E or e Electric
Others 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:

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
……
…….











Viewing all articles
Browse latest Browse all 4542

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>