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
Roman55 [17]
4 years ago
10

Write a Scheme function called "sum" which takes an input function func and a nonnegative number n and outputs the value

Computers and Technology
1 answer:
solong [7]4 years ago
7 0

Answer:

function sum(number) {

      if (number == 1) {

             return 1;

      }

      return number + sum(number -1);

}

Explanation:

This is a recursive function, it means that is a function that calls itself for example: if you call the function with sum(5) the process is :

sum(5)

   |______ 5 + sum(4)

                           |_______ 4 + sum(3)

                                                       |______ 3 + sum(2)

                                                                                   |_____2 + sum(1)

                                                                                                        |_____ 1

                                                                                                 

the result is 1+2+3+4+5 = 15

You might be interested in
Xxx<br>uuuuuu<br>uuuu<br>jjnmn<br>jjh
Leviafan [203]
Answer: What’s this??
7 0
3 years ago
Which of the following best describes a good role model?
Alex787 [66]

Answer:

b

Explanation:

i am not sure

5 0
4 years ago
Read 2 more answers
A(n) ________ operator, such as the greater than or less than symbol, can be used in a query criterion to limits the results pro
Tcecarenko [31]

Answer:

A _comparison_ operator, such as the greater than or less than symbol, can be used in a query criterion to limits the results produced by the query

5 0
4 years ago
Read 2 more answers
What are the ASE special certifications?
kykrilka [37]

Answer:

It is The National Institute for Automotive Service Excellence.

Explanation:

8 0
3 years ago
Read 2 more answers
What are some things that games were historically used for?
madreJ [45]

Answer:

D) All of the above

Explanation:

All of these options are true.

Hope it helps and is correct!

5 0
3 years ago
Other questions:
  • Which change signaled a musical progression toward rock and roll?
    14·1 answer
  • You have just driven to the Hewlett-Packard site in Corvallis to field-interview a programmer. You sit down in a conference room
    6·1 answer
  • Computer piracy occurs when what is violated
    6·1 answer
  • How do optical discs store data? select one:
    15·1 answer
  • In one to two sentences, explain why citizens pay taxes
    8·1 answer
  • Why save html documents as lowercase.?
    9·1 answer
  • In an income statement subtracting the cost of goods sold from the net sales provides the?
    11·1 answer
  • ---------------is a systematic review of a person’swork and achievements over a recent period, usually leading toplans for the f
    11·1 answer
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • Program Convert Measurements:
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!