1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Novay_Z [31]
3 years ago
4

Declare a class named PatientData that contains two attributes named height_inches and weight_pounds. Sample output for the give

n 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

Computers and Technology
1 answer:
Oksanka [162]3 years ago
4 0

Answer:

class PatientData():    #declaration of PatientData class

   height_inches=0  #attribute of class is declared and initialized to 0

   weight_pounds=0 #attribute of class is declared and initialized to 0

Explanation:

Here is the complete program:

#below is the class PatientData() that has two attributes height_inches and weight_pounds and both are initialized to 0

class PatientData():  

   height_inches=0

   weight_pounds=0  

patient = 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 before

print('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 user

patient.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 user

print('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 = 0

       self.weight_pounds = 0

self keyword is the keyword which is used to easily access all the attributes i.e. height_inches and weight_pounds defined 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.

You might be interested in
A. True
Naily [24]
True i think its  answer
4 0
3 years ago
What is theory of knowledge?​
Karolina [17]
Theory of knowledge (TOK) plays a special role in the International Baccalaureate® (IB) Diploma Programme (DP), by providing an opportunity for students to reflect on the nature of knowledge, and on how we know what we claim to know.
4 0
3 years ago
In Python write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs
stealth61 [152]

Answer:

l = []

while True:

 no = int(input())

 if no>0:

   l.append(no)

 else:

   break

print(1)

If this helped consider marking this answer as brainliest. Have a good day.

3 0
2 years ago
Professionally, depending on your career, you might use Excel to:
morpeh [17]

1. To track inventory on excel you should have thorough knowledge on how it is used and different techniques and buttons behave on it. Tracking inventory may use formulas for example the total amount of items sold for the specific day. So where to right formulas and how to use them should be learned.

2.Track personal loan will take a little knowledge about the tool and again here also a little amount of formulas can be used and thus will need a little knowledge that where to write them but will need less knowledge than first one.

3.Evaluation of commitments will need a very low knowledge about tool and can be used easily.

4. Track a project It also need a little knowledge about the tool and will need least knowledge if compared with other options.

6 0
3 years ago
Identify the three fuzzy logic systems in the given text.
Furkat [3]

Answer:

she is the both city CAA been Van from is next

4 0
2 years ago
Other questions:
  • Lydia used software and numerical data to create bar graphs. What software did she use?
    8·2 answers
  • Generate the requested sets using only set builder notation and the provided sets. Some problems may require you to build one or
    15·1 answer
  • When users talk about font size,
    10·2 answers
  • You are almost finished updating a Website. As part of the update, you have converted all pages from HTML 4.0 to HTML5. The proj
    7·1 answer
  • What is a 96.1791 weighted gpa in a 4.0 scale?
    8·1 answer
  • Not every organization integrates with the Internet, but all use some or most of the technology that gave rise to it.
    15·1 answer
  • Write code which takes two inputs from the user, a number of sides followed by a side length, then creates a regular polygon wit
    10·2 answers
  • I have a problem with my Nintendo DS lite does anyone know how to fix it?
    8·1 answer
  • You have an audio that contains one pause for 0.2 seconds and another one for 0.6 seconds. When do you need to create a new segm
    5·1 answer
  • Helppppppppppp please
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!