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
Lana71 [14]
3 years ago
8

Describe the scope of the variables in this code.

Computers and Technology
2 answers:
Solnce55 [7]3 years ago
7 0

Answer:

The scope of petName is local to the class pet.

The scope of color is accessible by all parts of the program.

Explanation:

The variable petName is local to the class, because the variable was created in a function whose name begins with two underscores.

The variable color, while created in the petCarrier class, is accessible to the entire function. It was not created in a function whose name begins with an underscore.

Correct answer edge 2020

tensa zangetsu [6.8K]3 years ago
6 0

Answer:

Scope of petName is only limited to class pet (pet class) and scope of color is accessible to the entire program.

Explanation:

petName is restricted by the contructor with an underscore: def __init__(self,strSpecies,strName):, meaning it cannot be manipulated outside that class and color does not have that.

You might be interested in
Consider a hypothetical microprocessor generating 16-bit addresses with 16-bit data accesses (i.e. each access retrieves 16 bits
Vlad [161]
A. number of addresses is 65536
b. memory capacity is 128 kbytes or 131072 bytes
c. The last memory address is FFFF which is 65535

8 0
3 years ago
how to create use an array of Course objects instead of individual objects like course 1, course 2, etc
AURORKA [14]

Answer:

To save the course object instances in an array, use;

Course[] courses = new Course[7];

courses[0] = new Course("IT 145");

courses[1] = new Course("IT 200");

courses[2] = new Course("IT 201");

courses[3] = new Course("IT 270");

courses[4] = new Course("IT 315");

courses[5] = new Course("IT 328");

courses[6] = new Course("IT 330");

Explanation:

The java statement above assigns an array of size 7 with the course class constructor, then order courses are assigned to the respective indexes of the new array.

3 0
3 years ago
How can solve a Boolean algebra problem?<br><br> Ex: JK+(~J+~K)L+JK
kicyunya [14]
I am not sure what you mean by that but a boolean is either true or false. So it is kind of like a true or false question. 4+4=7 is false. 2*4!=48 is true.
8 0
2 years ago
Jenn wants to assign a value to the favorite car variable: favoriteCar = Toyota but gets an error message. What does she need to
Valentin [98]

Answer:

The correct answer is:

Option D: Put Quotation marks around the string

Explanation:

There are various data types that are used to store data in programming i.e. numeric, alphabetic, alphanumeric etc.

Given that Jenn wants to store the value in variable. The names of cars are usually rods and the data type for them is string.

Whenever a string is used, quotation marks are used around it. The quotation marks make it easier for the compilers and interpreters to identify string.

Hence,

The correct answer is:

Option D: Put Quotation marks around the string

8 0
3 years ago
The safest action to take if someone claiming to be from your bank calls you to ask for account information is to
Fofino [41]
Hang up, and inform your (real) bank that someone may attempt to steal your identity and your money.
6 0
3 years ago
Read 2 more answers
Other questions:
  • If you press the tab key when you're in in the last cell of a table,
    10·1 answer
  • Which best describes inserting a table using the Table Gallery
    10·2 answers
  • ? Assessment
    12·1 answer
  • CodeHS 3.4.5. What is the code for four colored triangles.
    8·1 answer
  • Radio waves can be used to transmit energy. What is an advantage of this method in computer technology
    7·2 answers
  • Cursor/Blinking line is used to show current_ on document. A- Color b- Status c- Type d- Location
    11·1 answer
  • How many grams are in 100 pounds?
    6·2 answers
  • NWhen you measure a person’s weight, you are measuring the
    15·2 answers
  • Activity #2
    13·1 answer
  • To delete unnecessary files on a hard disk use software
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!