Solved:

Checkmark

Answered by AI, Verified by Human Experts

Declare a class named PatientData that contains two attributes named height_inches and weight_pounds. Sample output for the given program with inputs: 63 115 Patient data (before): 0 in, 0 lbs Patient data (after): 63 in, 115 lbs 1 Your solution goes here ' 2 1 test passed 4 patient PatientData () 5 print('Patient data (before):, end-' ') 6 print(patient.height_inches, 'in,, end=' ') 7 print(patient.weight_pounds, lbs') All tests passed 9 10 patient.height_inches = int(input()) 11 patient.weight_pounds = int(input()) 12 13 print('Patient data (after):', end-' ') 14 print (patient. height_inches, 'in,', end- ') 15 print(patient.weight_pounds, 'lbs') Run

Declare a class named PatientData that contains two attributes named height_inches and weight_pounds. Sample output for the given program with inputs: 63 115 Patient data (before): 0 in, 0 lbs Patient data (after): 63 in, 115 lbs 1 Your solution goes here ' 2 1 test passed 4 patient PatientData () 5 print('Patient data (before):, end-' ') 6 print(patient.height_inches, 'in,, end=' ') 7 print(patient.weight_pounds, lbs') All tests passed 9 10 patient.height_inches = int(input()) 11 patient.weight_pounds = int(input()) 12 13 print('Patient data (after):', end-' ') 14 print (patient. height_inches, 'in,', end- ') 15 print(patient.weight_pounds, 'lbs') Run

Answer:class PatientData():#declaration of PatientData classheight_inches=0#attribute of class is declared and initialized to 0weight_pounds=0#attribute of class is declared and initialized to 0Explanation:Here is the complete program:#below is the class PatientData() that has two attributes height_inches and weight_pounds and both are initialized to 0class PatientData():height_inches=0weight_pounds=0patient = PatientData()  #patient object is created of class PatientData#below are the print statements that will be displayed on output screen to show that patient data beforeprint('Patient data (before):', end=' ')print(patient.height_inches, 'in,', end=' ')print(patient.weight_pounds, 'lbs')#below print  statement for taking the values height_inches and  weight_pounds as input from userpatient.height_inches = int(input())patient.weight_pounds = int(input())#below are the print statements that will be displayed on output screen to show that patient data after with the values of height_inches and weight_pounds input by the userprint('Patient data (after):', end=' ')print(patient.height_inches, 'in,', end=' ')print(patient.weight_pounds, 'lbs')Another way to write the solution is:def __init__(self):self.height_inches = 0self.weight_pounds = 0self keyword is the keyword which is used to easily access all the attributes i.e. height_inches and weight_poundsdefined within a PatientData class.__init__ is a constructor which is called when an instance is created from the PatientData, and access is required to initialize the attributes height_inches and weight_pounds of PatientData class.The program along with its output is attached....

Unlock full access for 72 hours, watch your grades skyrocket.
For just $0.99 cents, get access to the powerful quizwhiz chrome extension that automatically solves your homework using AI. Subscription renews at $5.99/week.