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...
-
How might being very strong with business analytics (such as analyzing reams of data and preparing spread sheets) help a person develop business strategy?
-
The following are Cohen Company's comparative financial statements for 2014, 2013, and 2012: Additional information: Credit sales were 65% of net sales in 2013 and 60% in 2014. At the beginning of...
-
For testing H0 : 1 = 2 versus H1: 1 2, we observe s1 = 9.3, s2 = 2.1, n1 = 6, and n2 = 13. Test at the significance level = 0.05. a. Find the critical value. b. Do you reject H0?
-
On September 30, Year 1, the Lester Company negotiated a two-year loan of 1,000,000 markkas from a foreign bank at an interest rate of 2 percent per annum. Interest payments are made annually on...
-
Suppose that there are 80 million American Depository Receipts, ADRs, listed on the New York Stock Exchange, NYSE, representing 20 million common shares of a UK co. - London Electronics Ltd. Right...
-
isabelle sterling, the partner you work for, unexpectedly had to travel to Hong Kong. She left you the Tang Aluminum Products file for your client, Global Bank. Global will be lending Tang 1.9...
-
Q 2. NC purchased a cement mixer for $ 14500. The mixer is expected to have a useful life of five years and a residual value of $ 1000 at the end of that time. Required: Prepare the journal entries...
-
Find the equation of the line that passes through (-2,4) and is perpendicular to the line passing through (-4,(1)/(3)) and (-2,(2)/(5)). Write the equation in slope -intercept form.
-
Write the equation of a quadratic function in standard form for the parabola that passes through the given points. (-1,5),(4,0),(5,-7),(1,9),(3,5),(0,8).
-
Shrewsbury Technologies, which manufactures high-technology instruments for spacecraft, is considering the sale of a navigational unit to a private company that wishes to launch its own...
-
Cliff Company manufactures file cabinets. The following cost information is available for the month of December: Beginning work in process Direct materials Conversion cost December costs Direct...
-
Maureen Smith is a single individual. She claims a standard deduction of $12,400. Her salary for the year was $213,800. Assume the following tax table is applicable. Single Individuals You Pay This...
-
Consider an RL electric circuit consisting of a resistor with resistance R (ohms) and an inductor with inductance L (henries) connected in series with an impressed voltage (electromotive force) E(t)...
-
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...
-
Think of an organizationa place of employment, a club, a sports team, a musical group, an academic societythat provided you with a significant work experience, and answer the following questions. 1....
-
What factors determine whether behavior in organizations is ethical or unethical? Divide up into small groups, and each person think of some unethical behaviors or incidents that you have observed in...
-
Now that you understand the nature of OB and management, and the kinds of issues they address, debate the following topic: Team A. The best way to increase organizational effectiveness is to clearly...
Study smarter with the SolutionInn App