Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Laboratory Exercises 1. Modules are a technique used in the development of Python applications which separate groups of functionally similar codes into Python files which
Laboratory Exercises 1. Modules are a technique used in the development of Python applications which separate groups of functionally similar codes into Python files which may later be used in other applications. These Python files may subsequently be " imported" into other Python scripts where in the functions they contain may be reused A Python application may in fact be a collection of imported modules with very little user developed code Python modules typically have three sources: 1. Modules delivered with the Python development environment 2. Modules supplied by third parties to support specific types of application development 3. Modules developed by the application developer in order to modularize the application and perhaps reuse the codes in other application development efforts The benefits of using modules have been outlined in our text but they are typi- cally: 1. Better software design approach by providing a natural means of dividing up programming tasks 2. An efficient means for reusing codes 3. Better quality assurance and quality control by creating separate units to be tested 4. Easier program an system maintenance by providing a unit to isolate changes (a) Creating a Python application using modules Below in Listing 1 and 2 are two custom program modules. These modules have been kept small for the purposes of this exercise. The first of these modules calculates the velocity of an object dropped from a height, h, due to the acceleration of gravity. The second module calculates kinetic energ of a mass, m, given its velocity. In this exercise you will duplicate these modules in a directory on your computer. In that directory you will create a program which imports them and uses the calculations they contain to answer the questions given below
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started