Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions: For this assignment, refer to instructions below list the assignment requirements. Patient File and BMI A text file contains patient ID , height (
Instructions:
For this assignment, refer to instructions below list the assignment requirements.
Patient File and BMI
A text file contains patient ID height in inches and weight in pounds For example: patientid height, weight
P
a Write a program that reads each line of the file, calculates the BMI for each patient, and displays each patient's ID and their BMI to the screen. The equation for BMI is:
BMI weight height
b Enhance your program so that the patient ID and BMI are saved to a file called bmi.txt
c Enhance your program so that if the height or weight data in the file are not numeric, the program will display an error message to the screen including the patient's ID
Create a Python code file named MLabFileProcessingFirstLast.py replace "FirstLast" with your own name
Add a title comment block to the top of the new Python file using the following form # A brief description of the project
# Date
# CSC MLab
# Your Name
Complete Exercise Patient File and BMI ayou will have to create a txt containing example provided under Patient File and BMI
Enhance code completed in step above by completing b under same exercise.
Enhance code completed in step above by completing c under same exercise.
In addition to getting the program to complete requirements listed in exercise enhance the program so that patient ID Height, Weight and BMI are saved to a CSV file called patientbmi.csv
Make sure you submit a zipped folder containing the following: text file you read the information from, the code could be one or two files if you considered modularizing, output file generated by code in step csv file generated by code in step
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started