Reference no: EM13167923
Function Name: overallGrade
Parameters:
1. ex1 - a number between 0 and 100 representing the exam 1 score.
2. ex2- a number between 0 and 100 representing the exam 2 score
3. ex3 - a number between 0 and 100 representing the exam 4 score.
4. ex4 - a number between 0 and 100 representing the exam 4 score.
5. fial -- a number between 0 and 100 representing the final exam.
Return Value:
A floating point number representing the average of all exam scores AFTER the
lowest score is replaced with the 2nd lowest score. .
Test Cases:
1. overallGrade(60,70,80,90,0) --> 72.0000
2. overallGrade(88,32.0,44,92,44.0) --> 62.400
3. overallGrade(60,60,70,80,90) --> 72.000
Description:
Write a function overall Grade that will calculate and return a student's 2316 exam
average. It will accept five parameters, which correspond to exam1,2,3,4 and the Final
grade. It should replace the lowest exam grade with the 2nd lowest exam grade, and then
calculate the average exam grade. You may assume that all exams will be a value
between 0 and 100.0, and that each exam has the same weight.
Function 2
Function Name: makeBLT
Parameters:
1. bacon - an integer representing the number of bacon strips
2. lettuce - an integer representing the number of lettuce leaves
3. tomatoes - an integer representing the number of tomato slices
Return Value:
An integer representing the number of BLT sandwiches you can make given the
inputted stock of ingredients.
Test Cases:
1. makeBLT(150, 20, 40) --> 6
2. makeBLT(1, 5, 51) --> 0
3. makeBLT(11, 3, 200) --> 1
Description:
Write a function that returns the number of BLT sandwiches you can make based on the
number of bacon strips, lettuce leaves, and tomato slices specified as inputs. Assume that it takes the following to make 1 sandwich:
- 10 bacon strips
- 3 lettuce leaves
- 6 tomato slices
Note that the number of sandwiches must be a whole number; you cannot have 1 1/2 of a
sandwich. For example, if you have 12 bacon slices, 20 lettuce leaves, and 5000 tomato
slices, you can only make 1 sandwich (despite the fact that you have enough lettuce and
tomato to make 6 sandwiches).
Hint: Python has a built-in function called min that takes in a comma separate list of
numbers and returns the minimum value. E.g. min(5, 3, 7) returns the number 3. This
may be useful in coming up with your solution.
You can solve this problem without using conditionals!
Function 3
Function Name: calcDistance
Parameters:
1. x1 - a number representing the x coordinate of the first point as an integer
2. y1- a number representing the y coordinate of the first point as an integer
3. x2 - a number representing the x coordinate of the second point as an integer
4. y2 - a number representing the y coordinate of the second point as an integer
Return Value:
A floating point number representing the distance between the two points.
Test Cases:
1. calcDistance(5,10,15,20) --> 14.142135623730951
2. calcDistance(-1,15,7, -3) --> 19.697715603592208
Description:
Write a function calcDistance that will calculate and return the distance between the two
given points as a floating point number. Use the distance formula given below:
Note that to successfully complete this problem, you will need to take the square root. To
do this, you must import the math module using "import math" before you use the square
root function, which is named sqrt. You can call functions from modules you import by
saying modulename.functionname(params) instead of just saying functionname(params).