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
when compared to an extravert, what is an activity an introvert is likely to do? compared to extraverts, introverts are
Veseljchak [2.6K]
An introvert is likely to stay inside and read all day. Compared to extroverts*, introverts are people who are less outgoing and sometimes prefer solitude than engaging with others.
7 0
2 years ago
Which statement describes a weather condition?
olchik [2.2K]

Answer:

I believe the answer is "The city is covered in snow"

Explanation:

the others aren't current conditions and pretty irrelevant

7 0
3 years ago
Read 2 more answers
What were the causes of the Whisky Rebellion?
Lerok [7]

Answer: The Whiskey Rebellion was caused by a whiskey tax imposed by Congress in 1791. In 1788, the federal government and the state governments were still obligated to pay off debts resulting from the American Revolution (1775–83).

3 0
3 years ago
I love glee who else does and no i am not a child
soldi70 [24.7K]

Answer:

My sister does but I don't watch it

4 0
3 years ago
Read 2 more answers
Which of the following is an open question? "Where are you from?" "When did you graduate from college?" "Why did you leave your
malfutka [58]
“Why did you leave your last job” because it is a question that doesn’t prompt a “yes” or “no” answer. It’s open because it starts a conversation.
5 0
3 years ago
Read 2 more answers
Other questions:
  • what type of conjuction is used in this sentence;Either you must stop eating from the refridgerator or you must pay me for it
    7·1 answer
  • Suppose a consumer has $150 to be spent on either books or video games. Video games cost $50 each and books cost $10 each. The c
    14·1 answer
  • Daniel is a junior psychologist in a prestigious research institute. Daniel studies the effects of sleep deprivation on rats. On
    10·2 answers
  • 1. Which of the following are legal ways of solid waste disposal?
    12·1 answer
  • Selects a strong reason to support argument. Identifies multiple, logical pieces of evidence that support reason. Evidence inclu
    6·1 answer
  • A person with a growth mindset believes
    11·1 answer
  • Core-periphery models are generally based on the idea that:
    7·1 answer
  • During a reflex, the brain is told about the action _____. after it happens before it happens while it happens
    14·1 answer
  • Which group was NOT one of the barbarian tribes that invaded the late<br> Roman Empire?
    12·1 answer
  • A) Identify ONE way in which the outcome of the Second World War in Asia contributed to political change in Asian states in the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!