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
sertanlavr [38]
3 years ago
14

public static int recur(int x) { if (x >= 0) return x + recur(x - 1); return 0; } What is returned by the method call recur(9

)?
Advanced Placement (AP)
1 answer:
guapka [62]3 years ago
6 0
9 >= 0 so return 9 + ...
8 >= 0 so return 8 + ...
7 >= 0 so return 7 + ...
6 >= 0 so return 6 + ...
5 >= 0 so return 5 + ...
4 >= 0 so return 4 + ...
3 >= 0 so return 3 + ...
2 >= 0 so return 2 + ...
1 >= 0 so return 1 + ...
0 >= 0 so return 0 + ...
-1 is not >= 0 so return 0.

Now string together all the returns..
9+8+7+6+5+4+3+2+1+0+0=45

recur(9) returns 45
You might be interested in
Question:
vovikov84 [41]

Once upon a time there lived a lovely princess with fair skin and blue eyes. She was so fair that she was named Snow White. Her mother died when Snow White was a baby and her father married again. This queen was very pretty but she was also very cruel. The wicked stepmother wanted to be the most beautiful lady in the kingdom and she would often ask her magic mirror, “Mirror! Mirror on the wall! Who is the fairest of them all?” And the magic mirror would say, “You are, Your Majesty!” But one day, the mirror replied, “Snow White is the fairest of them all!” The wicked queen was very angry and jealous of Snow White. She ordered her hunt

4 0
3 years ago
Gary is using several charts and tables to learn about patterns of migratory birds. Which information reference is he
Shtirlitz [24]
Google them.
hope this helps
4 0
3 years ago
Read 2 more answers
At which stage of a criminal trial does the judge analyze evidence and ask the defendant to enter a plea?
svlad2 [7]

Steps in a Criminal Case

A Crime Is Allegedly Committed

Police are notified and investigate an alleged crime by interviewing victims, witnesses, suspects, gathering physical evidence, taking photographs, measuring the crime scene, and taking fingerprint and DNA samples if available.


A Person Is Arrested

Police may arrest a suspect on the spot or if the officer has probable cause to believe a misdemeanor or felony was committed. The police may refer the case to the District Attorney’s Office suggesting potential charges.


The District Attorney’s Office Reviews The Case

A prosecuting attorney will determine whether a person should be charged with a crime by thoroughly reviewing all reports and records, witness statements, and the suspect’s prior criminal or traffic record. The criminal case is either charged or declined.


Criminal Charges Are Issued Or Declined

If a case is charged, the prosecutor issues a criminal complaint charging the suspect with committing a misdemeanor, felony, or both. Persons charged with a misdemeanor may be able to post bail and be released from jail. Persons charged with a felony crime must wait for their initial appearance in Arraignment Court.


Initial Appearance

This is the first court hearing after someone has been arrested and charged with a crime. The judge or court commissioner informs the defendant what the charge(s) are, maximum penalty if convicted, and their rights to an attorney. If the defendant is still in jail, bail and any other conditions are set. Often a “No Contact Order” will be imposed, which prohibits the defendant from having any contact with a person who is a victim or a witness in the case.


Entering A Plea

In misdemeanor cases, the defendant is asked to enter a plea of guilty, not guilty or no contest. In felony cases, a date is set for a preliminary hearing.


Status Conference

A court hearing to determine the status, or progress and direction, of a case.


Preliminary Hearing

This is an evidentiary hearing in which the District Attorney’s office must prove to a judge or court commissioner that there is enough evidence to believe the defendant committed a felony.


Arraignment

A criminal defendant's first appearance on the formal charges before a judge. The defendant is formally charged and enters a plea of guilty, not guilty, or no contest. This occurs at the initial appearance in misdemeanor cases and at some point following bind over at preliminary hearings in felony cases.


Pretrial Conference / Court Settlement Conference

A court hearing to resolve issues in advance of a trial; courts sometimes will accept entry of pleas of guilty or no contest at these hearings.


Plea Hearing

A hearing at which the defendant's responds to a criminal charge by entering a plea of guilty, not guilty or no contest. A plea agreement or plea bargain is an agreement between the prosecutor and the defendant for the defendant to plead guilty or no contest under certain terms and conditions, which must be approved by the judge, to prevent going to trial.


Trial

A hearing at which evidence is presented to a judge or jury to determine whether the defendant is guilty beyond a reasonable doubt. A defendant may be found guilty of all, some, or none of the criminal charges.


Sentencing

A court’s decision as to the penalties appropriate for crimes established by convictions.


Appeal

A defendant may appeal their case after sentencing.


Post-Conviction Motion Hearing

A defendant may be revoked for not following the terms of his probation. Post-Conviction Motions may be filed to deal with any post-conviction issues.



3 0
3 years ago
Read 2 more answers
How do i quiet a baby?
den301095 [7]

Play with the baby, feed it , or maybe change the diaper

7 0
3 years ago
If enough experimental data supports a hypothesis, then it:
aleksandr82 [10.1K]

Answer: C) Is accepted as true until proven false

==========================================================

Explanation:

We cannot prove the hypothesis to be 100% true because there might be data out there that we haven't accounted for, or some scenario that we haven't thought of yet. There's always going to be room for uncertainty and doubt. Keep in mind that such doubt does not necessarily mean that the theory is automatically false.

So all of this rules out choice A.

Choice B is ruled out as well because data supporting a hypothesis doesn't falsify the hypothesis. The term "falsify" means "to prove false" as you'd expect.

Choice C is the answer because the data seems to support the hypothesis and again we leave room for error. It's quite possible that in some unspecified date in the future, there are better methods of measurement to get a better sense of what's going on.

Choice D is ruled out because a law refers to something like the law of gravity. It's something you observe but it doesn't explain why something works. It doesn't provide the underlying mechanics of what's going on. We simply just report what we see which is exactly what an observation is.

6 0
3 years ago
Other questions:
  • Describe mammary gland ​
    10·1 answer
  • Can anyone who's good at Java help me with these? I'm really lost and have a week before school ends
    8·1 answer
  • state 5 different ways in which SATourism promotes Tourism development and Growth in south Africa as Destination of choice both
    5·1 answer
  • In your own words, define “ study habits.”
    7·2 answers
  • What is a biosolid ? How do they become usable ?
    14·1 answer
  • What core concepts make up the psychology of personality?<br> Relates to AP psych thank you!
    10·1 answer
  • What was the 4th glass for in a full course meal?
    10·1 answer
  • The algorithm below simulates rolling a regular 6-sided die twice. Consider the goal of determining if the sum of the values of
    10·1 answer
  • In which situation has the precautionary principle been most strictly applied? (3 points)
    5·1 answer
  • Read this story.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!