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
valentina_108 [34]
4 years ago
8

The main purpose of a constructor is to initialize the data members at the moment that an object is created. true or false?

Computers and Technology
1 answer:
GalinKa [24]4 years ago
4 0

Answer:

True

Explanation:

In Object Oriented Programming, a constructor is a type of subroutine whose purpose is to create an object.

when the constructor is called, it initializes the data members of the object and establishes the invariant of the class.

Some important concepts:

Data members: The data members are the data encapsulated within the object (e.g. int hour for the variable <em>'hour'</em> in an object called <em>'date'</em>)

Invariant of the class: The class invariant is the invariant used to constrain the object (e.g. values between 0 and 24 for the variable <em>'hour'</em>)

You might be interested in
Catastrophic injuries and illnesses account for two-thirds of total health care costs in the country of Gnut. The Gnuti governme
Vilka [71]

Answer:

In the country of Gnut

The universal health insurance program that is likely to better allow Gnuti citizens to smooth consumption is:

program Y that would pay only for catastrophic illnesses and injuries.

Explanation:

Program Y is a better option for Gnuti citizens to smooth consumption.  The reason is that catastrophic injuries and illnesses already account for two-thirds of the total health care costs in the country.  These injuries and illnesses cost more income variability to the citizens than other health care expenses.  With the government sponsoring program Y, the citizens will be insulated from consumption patterns caused by income variability.  Consumption smoothing creates the needed balance between spending and saving during the different life phases for the citizens of Gnut.

3 0
3 years ago
Given that note, write a program which tells us the major scale starting at that note, using the pattern above. In the main bloc
White raven [17]

<u>Solution and Explanation:</u>

the_notes = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','B'] #original list

def get_scale(choice): #function to get the major diatonic scale

steps=[1,1,.5,1,1,1,.5] #separate list for steps

size=None

for i in range(0,12): #loop to find out the index of the note entered

if(the_notes[i]==choice):

size =i

break

new_notes=the_notes[size:] + the_notes[:size]

#the above statement rotate the list so that the entered note can become the first note in the new list(i.e new notes)

index =0 #

scale="" #a string to store the major diatonic scale

for i in range(0,7):

scale+=new_notes[index]+" "

if(steps[i]==1):

index = index+2

else:

index=index+1

return scale

#main block

while(1):

choice=input("What scale do you want or Q to quit? ")

if(choice=='Q'):

break

elif(choice in the_notes):

print(get_scale(choice))

else:

print("That is not a note")

5 0
3 years ago
1. Which of the following is a search engine?
Effectus [21]
<span>C)Google
D) Search engines often provide different results, even when you enter the same query.
</span>
6 0
3 years ago
Read 2 more answers
What is the role of the computer in banking system?
Daniel [21]

Answer: In banks, computers are used for keeping account information of customer accounts. Banks use technology to carry out payments effectively and successfully. Computers help bankers keep a record of and verify financial records much quicker. Hope this is helpful.

3 0
2 years ago
In end game, should you drink a chug jug just to get an extra 25-50 shield?
antiseptic1488 [7]
Yes, It's important to do that. The more shield you have the more you stay alive between 1v1s 

Hope this helps!
3 0
4 years ago
Other questions:
  • Why would Google combining information from separate accounts across its services and sites have privacy implications for its us
    11·1 answer
  • A cracked tone (reluctor) ring will often cause what type of problem
    13·1 answer
  • What is illegal to search on the internet?
    5·1 answer
  • Micheal has increased the contrast of the given picture. Which feature or menu option of a word processing program did he use? A
    15·1 answer
  • Sadie helman runs a web site for amateur snowboarders. she likes to post videos and music related to snowboarding on her site as
    12·1 answer
  • How to interchange first half of the array with second half of array in python?
    9·1 answer
  • A user complains that his new mouse doesn't work right. He has an old system at home and when he has had this problem, he cleane
    15·1 answer
  • Input an int greater than 0 and print every multiple of 5 between it and 0 inclusive in descending order. If the number is not g
    13·1 answer
  • It is important to consider the quality of the data being used when considering the accuracy of a conclusion. Incorrectly collec
    11·2 answers
  • Please help me!! (two questions)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!