Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Coding Questions: 1. Write a function, mult that multiplies two numbers, and returns the product. Choose how many parameters you need, and what names
Coding Questions: 1. Write a function, mult that multiplies two numbers, and returns the product. Choose how many parameters you need, and what names to use. 2. A) Write a function, add that adds two numbers, and returns the sum. Choose how many parameters you need, and what names to use. B) Write a function, add_sqrt that accepts two arguments: num_1, num_2. In the function, call your function add with arguments num_1, num_2. Then save the return valu of add a variable called sum. Next, call the math.sqrt function from the math library with the argument sum. Then save the return value of math.sqrt in a variable called root. Next, call the built-in function print with the parameter root 3. Write a program that finds the surface_area of a cube given the edge as an argument. The function should print the surface area and return it. 4. Write a program that calculates the tax using a function with two parameters: the wage and tax rate. The function should return the tax. Call this function in different ways. 5. Write two functions: an average function that finds and returns the average of some values given as arguments. Use the output of the average function as the argument of the grade function which outputs the letter grade, given the average grade. You can decide on the grade boundaries yourself. 6. Modify the temperature problem from Lab 6 so it uses functions. 1) Create a list with temperature values entered as input by the user. The program should allow the user to enter as many temperatures as they like, and only stop when the user enters "-1". From the list find the total temperature. Discard the temperature if it is not within the [0, 100] range and print a message if out of range. Calculate the total, the average temperature, the minimum, maximum and the median. 2) Use a for loop to print numbers from 1 - 10 3) Use a for loop to print multiples of 4 smaller than 21 4) Create a dictionary that maps hexadecimal numbers to their binary values with 16 entries. The program should output the binary value of the hexadecimal number. First you need to make sure that the key exists; if it doesn't the program should output a message and ask the user to try again.
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