Practice - Creating your own functions

The following assignments are written in a very different format from the previous weeks of python assignments. In each of these assignments you are to write a single function which MUST follow the naming and parameter requirements of the problem exactly. Your file should contain ONLY that function. It should not include any additional code.

When testing your code you should use the shell prompt examples provided. Your code must behave exactly the same way or it will not pass the Autolab tests.

THIS MEANS:


To complete this activity, you will need to create the following programs:


FUNC_01

In a file called time.py create a function called arrivalEstimate()

 

 

FUNC_02

In a file called bmi.py create a function called calculate()

 

FUNC_03

In a file called median.py create a function called getMedian()


FUNC_04

In a file called leap.py create a function called isLeapYear()

 

 


Testing Your Code

Note - These assignments are not evaluated for a grade. HOWEVER, they are vitally important to the process of learning how to program. I provided these assignments and the autograders so that you can judge whether you are making progress and so that we can focus our in class conversations in the sessions to come. Please make every effort to complete these problems prior to your next class session.

  1. Go to the AutoLab Homepage for the course
    1. https://hypnos.cs.uni.edu/courses/CSED1320-F21/assessments
    2. Log in if necessary
  2. For each of the assignments listed above, find their submission link under the "Practice" heading
  3. Upload the corresponding python file for that assignment.
  4. When the "handin history" page comes up you will need to refresh the page until a score of either 0 or 1 is shown with your assignment.
  5. Click on the 0/1 score to get feedback.
  6. Read the information carefully if you received a score of 0 and figure out what you need to do to fix the problem.
    • Ask for help from me or other students if you don't understand an error message.
  7. Resubmit until the program earns a 1.