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
kifflom [539]
3 years ago
9

Consider the code block below. What is the value of amount when this method is called twice, the first time using cookieJar(7) a

nd then using cookieJar(22)?
public static int cookieJar(int addCookies) {

int amount = 0;
amount += addCookies;
return amount;
}

a. 7
b. 15
c. 22
d. 29
e. An error occurs
Computers and Technology
1 answer:
Alex787 [66]3 years ago
4 0

Answer: 29

Explanation:

The variable amount is given a initial value of 0

Therefore, the first method call:

cookieJar(7)

amount + cookieJar

amount = 0 + 7 = 7

And the value of 7 is returned for amount at the start of the block

Thus, when cookieJar is called the second time ;

cookieJar(22)

amount + cookieJar

amount = 7 + 22 = 29

And the value of 29 is returned for amount at the start of the block

You might be interested in
A powerpoint ________ is a set of unified design elements.
natka813 [3]
<span>Within the elements of design, the set of elements of unified designs among them is called corporate because they create unity of identities of elements forming a set of equality of profiles and identities. Corporate is associated and collective to form equal elements and create a unit in the design.</span>
7 0
3 years ago
In poor weather , you should ___ your following distance.
svlad2 [7]

Answer:

lengthen

Explanation:

will take more time to stop on wet and slippery surfaces

3 0
3 years ago
How is binary used in pixels and in sound?
FinnZ [79.3K]

Answer:

Sound needs to be converted into binary for computers to be able to process it. To do this, sound is captured - usually by a microphone - and then converted into a digital signal. The samples can then be converted to binary. They will be recorded to the nearest whole number.

Explanation:

is this it?

3 0
3 years ago
Read 2 more answers
____ is the encapsulation of method details within a class.
Anestetic [448]

Implementation hiding i<u>s the encapsulation of method details within a class</u>. Implementation can be interpreted as those specifications which can be altered without altering the correctness of an application. Wrapping data/methods within classes (descriptions of the way all objects of this type will look/act) in combination with implementation hiding is called encapsulation. Information users need to know about behaviors should be available without dependence on implementation specifications.

6 0
3 years ago
How do i cancel my brainly premium account?
Vikki [24]

Answer:

press cancel

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Desktop, laptop, and tablet computers, and mobile devices are classified as _______.
    7·1 answer
  • Krystal recorded her times for all her cross-country meets this season. To sort her data showing the lowest times first, what wi
    14·2 answers
  • You can apply bold, italic, and underline styles to text. But why is it a good idea to use underline sparingly?
    13·2 answers
  • reate a class called Plane, to implement the functionality of the Airline Reservation System. Write an application that uses the
    5·1 answer
  • Jason works as an accountant in a department store. He needs to keep a daily record of all the invoices issued by the store. Whi
    13·2 answers
  • A computer is made of up 6 main components: a) CPU (central processing unit)
    7·1 answer
  • This program has some errors in it that are needed to be checked import java.io.*;
    13·1 answer
  • A collection of facts can be copyrighted, but only if the collection is ____ in a way that causes the resulting work to rise to
    14·1 answer
  • You would like to conduct a survey and ask your web page visitors to indicate the computer operating systems that they use. Each
    10·1 answer
  • to provide for ecmascript compatibility in older browsers, you can use group of answer choices javascript shivs javascript shims
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!