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
Kruka [31]
3 years ago
14

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:
RUDIKE [14]3 years ago
3 0

Answer:

C. 22

Explanation:

Given that the argument is being passed by value, there is no memory to consider.  So cookieJar(7) returns 7 and cookieJar(22) returns 22.

If the argument parameter was passed by reference or pointer, then perhaps the value from cookieJar(7) would be considered with cookieJar(22).

Note, this code block really isn't doing anything other than returning the value passed into it.  The "amount" variable is immediately set to 0, and then the value passed in is added to amount (which is 0), and returns.  The following code could replace this function:

public static int cookieJar(int addCookies){

return addCookies;

}

The above code will return an equivalent output to the given code.

Notice, the function is not dependent on any previous call, so the value for each is unique to the call itself, i.e., cookieJar(22) returns 22 and cookieJar(7) returns 7.

So, C. 22 would be correct.

You might be interested in
you'll be organizing the various databases in your organization, and have recommended hiring a/an?A. internet specialist B. comp
jek_recluse [69]
Either c or d, most probably D
7 0
3 years ago
Read 2 more answers
After selecting multiple calendars, how do you view them in one single calendar? Open the Backstage view and then the Calendar o
blsea [12.9K]

Answer:

its D. in the calendar view, click the view tab, and click they overlay button.

Explanation:

i just got it right on edge 2020

6 0
3 years ago
Read 2 more answers
your browsing the internet and realize your browser is not responding. which of the following will allow you to immediately exit
Mandarinka [93]

Answer:

Task Manager is the answer

8 0
3 years ago
Question #6
Vitek1552 [10]

Answer:

ValueError

Explanation:

Required

Determine the error the program returned

The above will return a ValueError error and the reason is as follows.

The first line of the program initializes variable as 'live'.

The next line tries to convert answer to integer and this is where it returns the error'.

On the second line, variable amount expects that the answer variable to contain number e.g. '567' but because it doesn't contain a complete number (i.e. unexpected values), the program returns a ValueError.

7 0
3 years ago
Read 2 more answers
Describe the steps involved in data mining or data analytics when viewed as a process of knowledge discovery.
Aleksandr [31]

Answer:

1. Data Cleaning

2. Data Integration

3. Data Selection

4. Data transformation

5. Data Mining

6. Pattern Evaluation

7. Knowledge presentation

Explanation:

The steps involved in data mining or data analytics when viewed as a process of knowledge discovery includes the following:

Step 1. Data cleaning: this involves the elimination of inconsistent data.

Step 2. Data integration: this involves the combination of data from multiple sources.

Step 3. Data selection: this is the step where significant data for task examination are gathered from the database.

Step 4. Data transformation: this the step in which the data are modified for mining by conducting the aggregate operation.

Step 5. Data mining: this step involves the extraction of data patterns through specific techniques.

Step 6. Pattern evaluation: this step involves the identification of patterns that depict knowledge based on measures.

Step 7. Knowledge presentation: this is the step in which visualization and knowledge representation methods are utilized to illustrate mined knowledge to users.

6 0
3 years ago
Other questions:
  • What does "Forward" in emails do?​
    7·1 answer
  • During the troubleshooting of a pc that will not boot, it is suspected that the problem is with the ram modules. the ram modules
    14·1 answer
  • How many electrons are there in an atom of carbon? A. Four B. Eight C. Six D. One
    15·2 answers
  • What is the impact of information technology in your daily life?
    12·1 answer
  • Write a java program which uses methods for calculating the sum of any 5 non-zero integer digits that are input. The program mus
    8·1 answer
  • Using a personal computer to produce high quality printed documents.
    10·1 answer
  • An attacker compromises the Washington Post's web server and proceeds to modify the homepage slightly by inserting a 1x1 pixel i
    12·1 answer
  • The area surrounding your car that can't be seen from the driver's seat is called
    14·2 answers
  • Which part of a touchscreen responds to pressure applied to its surface?
    6·1 answer
  • Discribe two ways you can zoom in and out from an image
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!