Homework 6-MATLAB Arrays This homework is an individual assignment. Upload all r
ID: 3588311 • Letter: H
Question
Homework 6-MATLAB Arrays This homework is an individual assignment. Upload all required files to eCampus by the due date. Remember to sign your work. The body Surface area (BSA) of a person in m2 can be calculated when the mass (in kg) and height (in cm) is known using the Du Bois formula: BSA = 0.007184 masso.425 height o 75 For example, the BSA of a person with a height of 187 cm and a mass of 75 kg would be calculated as 2.2759 m2. Write a function called bodySurfArea that accepts a 2-column array as input. The first column contains values of mass in kg and the second column contains corresponding heights in meters. Your function must use the Du Bois formula to compute the corresponding value of BSA for each mass-height pair of values. It should return a 3-column array with the mass, height, and BSA values in the respective columns Include help comments and other descriptive comments in both functions, and ensure that they do not accept nonsensical input.Explanation / Answer
import hashlib def hash_file(filename): """"This function returns the SHA-1 hash of the file passed into it""" # make a hash object h = hashlib.sha1() # open file for reading in binary mode with open(filename,'rb') as file: # loop till the end of the file chunk = 0 while chunk != b'': # read only 1024 bytes at a time chunk = file.read(1024) h.update(chunk) # return the hex representation of digest return h.hexdigest() message = hash_file("track1.mp3") print(message)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.