Question: 1. When there is a main function in Python, it will be automatically invoked by the operating system when the program is executed. True False
1. When there is a main function in Python, it will be automatically invoked by the operating system when the program is executed.
True
False
2. Why do we want to apply incremental development when programming?
3. We do not need to know the right answer when testing a function.
True
False
4. Define a function named timeConverter, which converts days to the total number of seconds and returns the seconds. Then write a program that prompt the user to enter the number of days, and call timeConverter function to show the number of seconds that the days have. Use a main function in your program.
5. The Mosteller Formula is often used by doctors to estimate the surface area of a person's body given height and weight. The formula is as follows, where hight is assumed to be in centimeters, weight is in kilograms, and surface is in square meters:
Write a function named as getSurfaceArea, which takes height and weight as parameters, calculates and returns the surface area by applying the above Mosteller Formula. Test your function with a program using a main function. Explain how would you use incremental development approach to develop this program.
6. Is a main function required by Python programming language?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
