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

  Assume an n × n matrix a is given

Assume an n × n matrix A is given, containing only 1's and 0's, such that, in each row, all 1's come before all 0's. Give an O(n log n) algorithm to count all 1's in A.

  Data file is a comma separated

The data file is a comma separated text values stored in a file with '.CSV' extension. The file has five columns corresponding to employee data fields listed above.

  Program to do the enciphering

Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.

  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.

  Function by sum of sines

code the program using an editor (DO NOT COMMAND LINE THE PROGRAM) and show the results

  Display the percent-ages of the overall grade

Write a program that uses a bar chart to display the percent-ages of the overall grade represented by the project, quizzes the midterm exam and the final exam

  Function should return a dictionary

Write a function numOccur(s), where s is a string; the function should return a dictionary whose keys are the 26 ascii letters abcdefghijklmnopqrstuvwxyz

  Fill in the python code

Fill in the Python code to play Tic Tac Toe. I won't award points unless it runs succesfully. # Tic-Tac-Toe Game def drawBoard(board): # Draws the board using the list of numbers print(" ") print(" ",board[0]," | ",board[1]," | ", board[2]) print("--..

  Improve the structural design - haunted house game

List the things you changed and the purpose of changing it. Good reasons include making code easier to read and easier to navigate when modifying it.

  The number of lowercase letters in the file

The number of uppercase letters in the file The number of lowercase letters in the file

  Permutation ciphers

Permutation Ciphers (a.k.a. Transposition Ciphers) are another class of simple cryptosystems. For this we use the functions apply(.,.) and inv(.) from Homework 4; copy these two functions into your le as auxiliary functions.

  Specializes in solving the equations ax=b by doolittle''s dec

Write a  program that specializes in solving the equations Ax=b by Doolittle's decomposition method, where a is the HIbber matrix of arbitrary size nxn

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