A) Write a function that accepts a train code of type character (lower or uppercase) and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
To answer part A of the question we can write the following function in Python def gettraintypetrain... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Figure P6.27 shows a simple practical amplifier that uses a 741 op-amp chip. Pin numbers are as indicated. Assume the op amp has a 2-M 2 input resistance, an open-loop gain A = 200,000, and an output...
-
write a program called MultipleChoice.java that creates a multiple choice question with 5 possible answers. Here is my code: public class MultipleChoice{ String question = (""), answerText = (""),...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
The friction at sleeve A can provide a maximum resisting moment of 125 N ? m about the x axis. Determine the largest magnitude of force F that can be applied to the bracket so that the bracket will...
-
On September 30, 2017, Coldwater Corporation purchased equipment for $1.1 million. The equipment was purchased with a $100,000 down payment and a three-year, 4%, $1-million bank loan for the balance....
-
Estimate the ' values for (a) A well-graded sandy gravel (GW) at a density of 1.9 Mg/m3. (b) A poorly graded silty sand with a field density of 1.70 Mg/m3. (c) An SW material at 100% relative...
-
Which of the following information system functions is generally responsible for the design, coding, and debugging of computer programs? (a) technical support (b) programming (c) operations (d)...
-
Phelps Corporation??s comparative balance sheet for current assets and liabilities was as follows: Adjust net income of $138,000 for changes in operating assets and liabilities to arrive at net cash...
-
(Appendix 11A) Preparing Net Cash Flows from Operating Activities-Direct Method Colassard Industries has the following data available for preparation of its statement of cash flows: Sales revenue...
-
Suppose that the two-dimensional vectors (X1, Y1), (X2, Y2), . . . , (Xn, Yn) form a random sample from a bivariate normal distribution for which the means of X and Y, the variances of X and Y , and...
-
. Complete the following hypothesis test given a sample with n = 110 and x-bar = 98.7. null hypothesis Ho:u = 98.6 alternate hypothesis Ha:u > 98.6 (greater than, right or one-tail test) test...
-
Identity three ways in which the systems approach to diversity and cultural competence in an individual health care organization contributes to improved outcomes. Notes: System approach to culture...
-
Waterway Company's Assembly Department has materials cost of $3 per unit and conversion cost of $3 per unit. There are 19000 units in ending work in process inventory which are 80% complete as to...
-
Using Solidworks, make a 3D solid model of the part shown below. 2x 8mm- 45 13 -80- 2x 09- METRIC -27- 30 R$4 -$32 15 CRS I REQD
-
Come up with a list of questions that you can ask your customers to understand their preferences in financial products. Be specific in your questions. Make sure to create both open and closed-ended...
-
Please read the instructions carefully. The following questions are related to the following risky securities issued by: Sainsbury: J Sainsbury PLC (Reg. no: 00185647). The holding company whose...
-
Let f(x)=3x^29x+2. (A) Find y and dy for the function f at x=2. (B) Graph the functions y and dy from part A. (C) Compute the values of y and dy from part A for x=0.3.
-
Ashlee, Hiroki, Kate, and Albee LLC each own a 25 percent interest in Tally Industries LLC, which generates annual gross receipts of over $10 million. Ashlee, Hiroki, and Kate manage the business,...
-
Jerry made the following contributions during 2012: His synagogue (by check).....................................................$680 The Democratic Party (by check)...
-
Diane is a single taxpayer who qualifies for the earned income credit. Diane has two qualifying children who are 3 and 5 years old. During 2012, Diane's wages are $17,100 and she receives dividend...
-
Joan is a self-employed attorney in New York City. Joan took a trip to San Diego, CA, primarily for business, to consult with a client and take a short vacation. On the trip, Joan incurred the...
-
During June 2019, its first month of operations, Weston Manufacturing Company completed the transactions listed below. Weston uses a job order costing system. Materials requisitions and the wages...
-
The following accounts and corresponding balances were drawn from Widjaja Company's 2012 and 2011 year-end balance sheets. During the year, \(\$ 68,000\) of unearned revenue was recognized as having...
-
What is the difference between an interestbearing note and a discount note?
Study smarter with the SolutionInn App