Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please clarify the variables, values, and parameters. Read through the list of 5 functions designs Choose 3 function designs that you want to work on

Please clarify the variables, values, and parameters.

Read through the list of 5 functions designs

Choose 3 function designs that you want to work on

In one Python file, create all three functions

Test your functions with the inputs provided

Create a stack trace for each of your 3 functions

Function Design Options

slopeByPoints - This function finds the slope of a line Links to an external site.that passes through a pair of points. It takes the coordinates of the two points (four integer values, x1, y1, x2, y2), and returns the slope of the line that passes through the pair of points.

when points are (4, 3) and (-2, -1), the slope should be 0.6666666666666666 (2/3)

when points are (1, 4) and (2, -2), the slope should be -6.0

pythagoras - [You may want to import the Python math module for this question; see the full hint below]. This function finds the longest side (hypotenuse) Links to an external site.of a right triangle given the two short sides. It takes the lengths of the two short sides (s1, s2), and returns the length of the longest side (hypotenuse).

short sides are 3 and 4, hypotenuse should be 5.0

short sides are 6 and 10, hypotenuse should be 11.661903789690601 Hint: You can use 3**2 to calculate square of 3, and math.sqrt(25) to find the square root of 25. To use math.sqrt() you will need to import the math module by inserting the following line at the top of your script:

import math

simonSaid - This function adds ", said Simon" to the end of a sentence. It takes a sentence, and returns a new sentence with ", said Simon" at the end.

input sentence is "Coding Python is fun", the output sentence should be "Coding Python is fun, said Simon"

isMultipleOfTen - This function tells you if a given number is a multiple of 10. It takes a number, and returns True if it is a multiple of 10; otherwise it returns False.

test this function with -4, 10, 10.5, 520, and 553

goForWalk - This function tells you whether you can go for a walk. It takes values for variables hasUmbrella and isRaining, and returns True if you can go for a walk; otherwise, it returns False.

The function should only let you for a walk when it is raining if you have an umbrella, and should let you go for a walk if it is not raining regardless of whether you have an umbrella

Test this function with all four combinations of whether you have an umbrella (True, False) and whether it is raining (True, False)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

How flying airoplane?

Answered: 1 week ago

Question

Can you see what limitations your purpose imposes on your strategy?

Answered: 1 week ago