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
Select all statements below that are TRUE for For...Next loops. A. It is used for a fixed number of iterations. B. It is used fo
sasho [114]

Answer:

A and C

Explanation:

The for next loop is used for a fixed number of iterations which is usually indicated in the syntax. It uses a counter that increments on each iteration. The loop terminates when the counter reaches the number of initially specified iterations. It is different from a while loop which depends on a specified condition evaluating to the Boolean 'true'.

7 0
3 years ago
Write a function in MATLAB that takes as an input a matrix of coefficients for a system of linear equations (A), the solution ve
Illusion [34]
Answer is A all the way to the right
7 0
3 years ago
What aspect should you consider before adding pictures to a document?
Luden [163]

Answer:

information?

Explanation:

picture are there to give a visual or make the document more appealing. if your wording and information isnt up to date or reasonable people wont lean to what you are saying as much.

8 0
3 years ago
Read 2 more answers
What Is What is the difference between system software and application software?<br>​
inna [77]

Answer:

Hope it helps have a nice day..

4 0
2 years ago
Given the int variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another int variable m
Marysya12 [62]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int x=5,y=2,z=9;

   int min;

   // find the smallest value and assign to min

   // if x is smallest

   if(x < y && x < z)

   // assign x to min

    min=x;

     // if y is smallest

else if(y < z)

 // assign y to min

    min=y;

// if z is smallest

else

 // assign z to min

    min=z;

// print the smallest

cout<<"smallest value is:"<<min<<endl;

return 0;

}

Explanation:

Declare and initialize variables x=5,y=2 and z=9.Then check if x is less than y and x is less than z, assign value of x to variable "min" .Else if value of y is less than value of z then smallest value is y, assign value of y to "min".Else z will be the smallest value, assign its value to "min".

Output:

smallest value is:2

6 0
3 years ago
Other questions:
  • What is the key benefit of using RAM in a computer?
    12·1 answer
  • Write a statement that reads 5 successive integers into these variables that have already been declared : x1 x2x3x4 x5. Then wri
    7·1 answer
  • Each object that is created from a class is called a(n) ____________ of the class.
    5·2 answers
  • The advent of optical discs was made possible by developments in ____ technology.
    5·1 answer
  • You recently started working part-time in a retail store, and are learning about the reading devices your store uses. Your store
    6·1 answer
  • For the function definition int SomeFunc( /* in */ int alpha, /* in */ int beta ) { int gamma; alpha = alpha + beta; gamma = 2 *
    6·2 answers
  • Give two advantages of representing integers in pure binary.
    5·1 answer
  • What is the working principle of computer?​
    10·1 answer
  • How can i fix a all white phone screen
    11·2 answers
  • In QBasic, create a number guessing challenge. Your program should generate a random number from 1-
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!