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
charle [14.2K]
3 years ago
12

Ben wants to create a Book class that has an instance variable serialNumber. Where should he declare the instance variable

Computers and Technology
1 answer:
MrMuchimi3 years ago
4 0

Answer:

within the Book class but needs to also be outside of any methods.

Explanation:

If Ben is creating an entire Book class then the instance variable needs to be within the Book class but needs to also be outside of any methods. If Ben places the variable inside a method it can only be used by that method and therefore becomes an instance variable of that method and not the class. By creating it inside the class and outside the methods it can be used every single time a Book object is created. Therefore, creating an instance variable of serialNumber every time.

You might be interested in
How do you get Brainliest on a question?
Mama L [17]

Answer:

yes that is the way things work and I think for the answer to be marked brainiest there must be two answers that were posted.

Explanation:

Hope this helps:)

5 0
3 years ago
Read 2 more answers
We have removed
Tanzania [10]

There were N balls but we took A balls out, so there are now N-A balls. We add B balls and now we have N-A+B balls.

The program that computes this (I will use python as language has not been specified is the following):

n, a, b = int(input()), int(input()), int(input())

print(f"There are {n-a+b} balls in the box")

# Hope this helps

8 0
3 years ago
A file can be safed with a different file name then it currently has by clicking on save ? in the file tab
Mazyrski [523]

Answer:

Click the File tab. Click Save As. Choose a file location, such as OneDrive or This PC to store your file.

Explanation:

click the File tab. Click Save As. Choose a file location, such as OneDrive or This PC to store your file. In the File name box, enter a new name for the file. In the Save as type list, click the file

5 0
2 years ago
Design and implement an algorithm that gets as input a list of k integer values N1, N2,..., Nk as well as a special value SUM. Y
satela [25.4K]

Answer:

Follows are the code to this question:

def FindPair(Values,SUM):#defining a method FindPair  

   found=False;#defining a boolean variable found

   for i in Values:#defining loop for check Value  

       for j in Values:#defining loop for check Value

           if (i+j ==SUM):#defining if block that check i+j=sum

               found=True;#assign value True in boolean variable

               x=i;#defining a variable x that holds i value

               y=j;#defining a variable x that holds j value

               break;#use break keyword

       if(found==True):#defining if block that checks found equal to True

           print("(",x,",",y,")");#print value

       else:#defining else block

           print("Sorry there is no such pair of values.");#print message

Values=[3,8,13,2,17,18,10];#defining a list and assign Values

SUM=20;#defining SUM variable

FindPair(Values,SUM);#calling a method FindPair

Output:

please find the attachment:

Explanation:

In the above python code a method, "FindPair" is defined, which accepts a "list and SUM" variable in its parameter, inside the method "found" a boolean variable is defined, that holds a value "false".

  • Inside the method, two for loop is defined, that holds list element value, and in if block, it checks its added value is equal to the SUM. If the condition is true, it changes the boolean variable value and defines the "x,y" variable, that holds its value.
  • In the next if the block, it checks the boolean variable value, if the condition is true, it will print the "x,y" value, otherwise, it will print a message.  

6 0
3 years ago
What was the process called that required the photographer to have a tent or darkroom handy so that chemicals could be mixed qui
Vinil7 [7]

The process wherein it required the photographer to have a tent or darkroom handy so that chemicals could be mixed quickly and used while still wet is called photographic printing or print processing.

This process uses chemically sensitized paper to produce a final image on paper for viewing.

6 0
3 years ago
Other questions:
  • What are preconceptions?
    9·2 answers
  • What is last mile in VOIP
    13·1 answer
  • What college degrees did Steve Wozniak earn?
    10·1 answer
  • How can utility poles be eliminated as roadside hazards
    9·1 answer
  • While these two approaches have similarities in terms of the topics they address, ________ will cover broad IT management topics
    7·1 answer
  • What is the advantage of postfix notation?
    6·1 answer
  • Please help explain this calculator code.
    13·1 answer
  • What are the values of a[k] and a[k+1] after code corresponding to the following pseudocode runs?
    9·2 answers
  • Why do ineed to upgrade to see answers isnt it enough adds
    15·2 answers
  • An organized file title helps save time locating files, communicates professionalism, and lets us know the file is most likely N
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!