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
In a geographic file arranged by state and then city, you would file a letter from a company that does not have an individual or
telo118 [61]

Answer:

D. General State folder.

Explanation:

In <em>geographical filing</em>, files received by persons, organizations, firms or businesses are categorized according to their location. This filing method can then be arranged according to numeric or alphabetic order as determined by the filing organization.

Persons, business or organizations that do not specify their business location are placed in a general state folder until their locations are identified.

4 0
4 years ago
You can have more that one image open at a time in GIMP. True or false
hram777 [196]

Answer:

true....... you can superimpose so that's more than 1 image

6 0
3 years ago
Which display technology was developed by apple, produces vibrant colors, and supports viewing from all angles?
Vedmedyk [2.9K]
4.5K Retina display I think that is the answer you’re looking for
3 0
2 years ago
This is due in like an hour but I'm confused so please do lend assistance
blagie [28]
Yes you do have to program it first.
4 0
3 years ago
Peter is software designer working at a big software company. He just found out that he has been shifted to their downtown branc
sweet [91]

The managers at Peter’s company have an Autocratic environment.

<u>Explanation:</u>

The managers who are autocratic in nature make decisions on their own. They will never get insights of their employees and they will not take the inputs of them in taking any decisions. This type of management is suitable in an organisation where there is an urgent need to taking decisions to any matter.

Managers who are autocratic in nature will make decisions without consulting anyone's advice.  This type suits those organisations wherein there are very less number of employees. Here, the manager of Peter did not consulted peter in making decisions related to him, the environment is authoritarian or autocratic.  

7 0
3 years ago
Other questions:
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • How would you determine if your earned credits would transfer to a regionally accredited school?
    14·2 answers
  • In JavaScript, which of the statements below can be used for string declaration?
    11·1 answer
  • Write a program thattakes a number x and its exponent y from the user and thencalculate the result
    10·1 answer
  • Given that n refers to a positive integer, use a while loop to compute the sum of the cubes of the first n counting numbers, and
    12·1 answer
  • If you are involved in a collision that results in property damage, injury, or death, you must call
    13·1 answer
  • A Network Systems employee set up a network-wide password system in which other employees log in to access their work. Which tas
    6·2 answers
  • What are some recent inventions that have improved the quality of your life?
    10·1 answer
  • High speed printer that produce higher quality printouts but are more expensive is
    15·1 answer
  • Tick the best alternatives 1. Which one of the following is input device? a) Speaker b) Printer c. Monitor d. Mouse​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!