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
Space management is a<br> driving method.<br> A. lazy<br> B. defensive<br> C. fast
stiv31 [10]

Answer:B

Explanation:

Correct answer using online sources

8 0
3 years ago
D-H public key exchange Please calculate the key for both Alice and Bob.
Nesterboy [21]

Answer:

See explaination

Explanation:

Please kindly check attachment for the step by step solution of the given problem.

6 0
4 years ago
The most common layout of keys on the keyboard is the _____ keyboard.
Alex
The most common layout is called "QWERTY" because it is the first six letters on the keyboard.
6 0
3 years ago
Read 2 more answers
Mary wants to create 3D shapes, refraction, and cloud patterns in an image. Which filter should Mary use?
Lapatulllka [165]

Answer:

D. artistic filter

8 0
4 years ago
Insufficient vacuum will require the driver to _______________ to adequately activate the brakes?
sp2606 [1]
A i think idk im trying to earn points
8 0
3 years ago
Other questions:
  • Which technology uses regular phone lines and transmits at speeds up to 256 kbps?
    15·2 answers
  • Which network component allows computers to communicate on a network without being connected directly to each other?
    9·1 answer
  • Define a void function that calculates the sum (+), difference (-), product (*), quotient (/), and modulus (%) of two integer nu
    14·1 answer
  • HELP ME FAST???
    15·1 answer
  • How many bits long is a autonomous system number?
    13·1 answer
  • A message can be...........<br>differently by different people.​
    8·1 answer
  • Which one of these is NOT an indicator that an email is spam?
    5·1 answer
  • Write the issue related to the cyber ethnic. ​
    7·2 answers
  • You decided to upgrade your PC with a faster processor. To do this, you ordered a new motherboard over the Internet that support
    10·1 answer
  • Void printInfo()
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!