Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assumptions and Submission: You can make the following assumptions: 1. The names of airplanes will not have any spaces 2. The list of airplanes will

image text in transcribedimage text in transcribedimage text in transcribed
Assumptions and Submission: You can make the following assumptions: 1. The names of airplanes will not have any spaces 2. The list of airplanes will not always contain the same number of airplanes For full marks, match the output styling shown in the test cases exactly. Remember to comment your code, describing what it is doing, as discussed in class. Remember to follow proper naming conventions. This assignment is splitinto two parts. You must submit both a parametric modelling (contained in a PDF) and a .py file zipped. Part 1 Submitted via PDF Welcome to CS1003 International Airport! You have been hired by this airport to develop a program that involves calculating various values for airplanes thatwill help air traffic control. An airplane takes off from rest at an acceleration of +2.50m/s? for 185km. Once in the air, the plane must slow down at a deceleration of -0.50m/s? until it reaches a constant speed of 1080km/h to avoid other planes in the surrounding area. What is the distance the airplane travels while decelerating? Hint: you will need to find the velocity of the airplane atthe end of the acceleration period to calculate the displacement. Assume air resistance and wind speed will be negligible. Helpful Formulas: d, = V; At + 0.5a,At? Vo=V +a,At sz = sz + 2a,4d, a, = Acceleration of take of f in m/s? a, = Deceleration until constant velocity inm/s d, = Distance travelled while acceleration inm d, = Distance travelled while deceleration inm V; = Initial Velocity inm/s V, = Peak velocity after acceleration inm/s V; = Deceleration until constant velocity inm/s At = Time until maximum velocity in seconds 2 Part 2 Write a Python program that asks the user in main for one single input that contains a string of airplane names (Separated by a space). The string will not always contain the same number of airplanes, but you can assume the format will always be the same. Example of airplane string: WrightFlyer BleriotX! SupermarineSpitfire Boeing787 You should then create a loop that performs string searching and slicing to remove the plane names from the inputted string and stores each within a python list. The user should then be prompted to select which plane out of the ones they entered that they would like to calculate for (the user will inputa number at this stage, that number can be used to get the name of the plane from the list we created). In the eventthat the user inputs a negative number or a number that exceeds the length of the list, they should be asked to reinput the plane they would like to calculate for. After the user selects a plane, they should be asked to input the various values needed to calculate the distance the plane traveled while decelerating. The prompts for these inputs should contain the name of the plane that the calculation is being done for (see sample outputbelow). These values should be passed to a function which will be based on your solution from part one. The distance the plane traveled while decelerating should be returned from the function and used in the final output. Sample Input and Output: TestCase 1: Input the list of airplanes: Airbus202 Boeing727 Spitfire What plane within your list would you like to calculate (as a number)? 1 Input acceleration of Airbus202 in m/s"2: 0.75 Input distance of acceleration of Airbus202 in km: 150 Input deceleration of Airbus202 in m/s*2: 0.5 Input final velocity of Airbus202 in km/h: 900 The Airbus202 accelerates for 150.0km and decelerates for 162.50km Test Case 2: Input the list of airplanes: Airbus202 Boeing727 Spitfire BleriotXI What plane within your list would you like to calculate (as a number)? -1 Input invalid, please input the plane within your list you would like to calculate for: 2 Input acceleration of Boeing727 in m/s^2: 0.7 Input distance of acceleration of Boeing727 in km: 160 Input deceleration of Boeing727 in m/s^2: 0.4 Input final velocity of Boeing727 in km/h: 800 The Boeing727 accelerates for 160.0km and decelerates for 218.27km

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

1119563097, 9781119563099

Students also viewed these Physics questions