|
| 1 | +# Lab Test 3 |
| 2 | + |
| 3 | +## Instructions |
| 4 | + |
| 5 | +**Time Limit:** 60 minutes |
| 6 | +**Software Required:** **Python (VS Code)** |
| 7 | +**Submission:** Upload Python file (.py) to Google Form |
| 8 | + |
| 9 | +### Rules |
| 10 | +- No phones or AI tools allowed |
| 11 | +- No collaboration with other students |
| 12 | +- Must use Python only |
| 13 | + |
| 14 | + |
| 15 | +### Submission Process |
| 16 | +1. Complete your Python program |
| 17 | +2. Save the file as: `lab-test-3.py` |
| 18 | +3. Upload the file to the Google Form: |
| 19 | + - **C01:** [Click here](https://forms.gle/zfSRwUb2k1EcQzqg7) |
| 20 | + - **C02:** [Click here](https://forms.gle/FU6howfLoAiRbNh9A) |
| 21 | +4. Fill in all required information in the form |
| 22 | + |
| 23 | +### What to Submit |
| 24 | +- Python file named `lab-test-3.py` |
| 25 | +- Ensure the program runs without errors |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +# Questions |
| 30 | + |
| 31 | +## Topic 3: File Handling (CSV) |
| 32 | + |
| 33 | +### Learning Objective |
| 34 | + |
| 35 | +(p) Construct a Python program using CSV file handling with control structures |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +### Required File |
| 40 | + |
| 41 | +**Download the `bmi.csv` file:** [Download here](../bmi.csv) |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +### Question |
| 46 | + |
| 47 | +Create a program with **TWO functions** that performs the following tasks: |
| 48 | + |
| 49 | +#### Section 1 (Function 1) |
| 50 | +1. Open the CSV file and **print all of its content** to the console |
| 51 | +2. **Calculate and display the average height** in the dataset |
| 52 | + |
| 53 | +#### Section 2 (Function 2) |
| 54 | +1. **Add your own data** (Gender, Height, Weight, and BMI Index) to the file using standard input |
| 55 | +2. **Close the file** |
| 56 | +3. **Re-read the file** to verify that the new row has been successfully added |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +### Rubric |
| 62 | + |
| 63 | +<img src="/assessments/lab-test-3-rubric.png" alt="Lab Test 3 Rubric" width="100%"> |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +Good luck |
0 commit comments