Ask Python Expert

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).

Python, Programming

  • Category:- Python
  • Reference No.:- M9458039

Have any Question?


Related Questions in Python

Part i the assignment filesone of the most important

Part I: The Assignment Files One of the most important outcomes of this assignment is that you understand the importance of testing. This assignment will follow an iterative development cycle. That means you will write a ...

Homework -this homework will have both a short written and

Homework - This homework will have, both a short written and coding assignment. The problems that are supposed to be written are clearly marked. 1) (Written) Make heuristics Describe two heuristics for the slide problem ...

Tasksdemonstrate data scraping of a social network of

Tasks Demonstrate data scraping of a social network of choice. Develop technical documentation, including the development of the code & detailing the results. Provide a report on the findings, that includes research into ...

Assignment1 utilising python 3 build the following

Assignment 1. Utilising Python 3 Build the following regression models: - Decision Tree - Gradient Boosted Tree - Linear regression 2. Select a dataset (other than the example dataset given in section 3) and apply the De ...

Python programming assignment -you first need an abstract

Python Programming Assignment - You first need an abstract base class, called, Account which has the following attributes and methods: accountID: This attribute holds the ID assigned the account , if not provided set to ...

Learning outcomes lo3 - research develop and document a

Learning Outcomes LO3 - Research, develop, and document a basic security policy, and analyse, record, and resolve all security incidents LO4 - Identify and assess the threats to, and vulnerabilities of networks Assessmen ...

Question research pythons dictionary data type dictdiscuss

Question : Research Python's dictionary data type (dict). Discuss its interface and usage. Include examples. Discuss practical applications of dictionaries.

Questionwhat is a python development frameworkgive 3

Question What is a python development framework? Give 3 examples python development framework used today. and explain which development framework is used in which industry.

Below zero - ice cream storethe local ice-cream store needs

Below Zero - ice cream store The local ice-cream store needs a new ordering system to improve customer service by streamlining the ordering process. The manager of the store has found that many orders are incorrect and s ...

The second task in this assignment is to create a python

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3) Problem Task In this problem, your input w ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As