Grade that will calculate and return a student''s exam

Assignment Help Python Programming
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).

Reference no: EM13167923

Questions Cloud

4 bit binary representation using excess 7 : Assuming a 4 bit binary representation using excess 7 list all bit sequences for integers -7 to +8
Function that takes as input parameters : Define a function that takes as input parameters a function handle f, start and end values a and b, and a number of steps n. The function should compute and return the x and y values of the maximum of the function over the range a to b.
Program [hcs12 assembly language] to compute the average : Write a program [HCS12 assembly language] to compute the average of an array of N 8-bit numbers and store the result at $1000
Explain what would be the effect on experiment : What would be the effect on this experiment if a tiny thin film of MgO were present on the surface of the Mg ribbon?
Grade that will calculate and return a student''s exam : 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
Calculate the change in ph of a buffer solution : Calculate the change in pH when 3.00 mL of 0.100 M HCl(aq) is added to 100.0 mL of a buffer solution that is 0.100 M in NH3(aq) and 0.100 M in NH4Cl(aq).
Compute the mean and median : Compute the mean and median and determine the shape of the distribution based on the sample data? Explain your conclusion.
Write a program that reads a list of real numbers. : Write a program that reads a list of real numbers. After the program ends it should print out only the unique numbers
State what is the exact reaction mechanism of the hydrolysis : What is the exact reaction mechanism of the hydrolysis of maleic anhydride with heat followed by adding a zinc catalyst

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd