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
Write the pseudo-code of an algorithm that returns the sum of all integers in a list of integers. You may use the Pascal-like ps
Arlecino [84]

Answer:

//variable integer_list to hold a list of integers

DECLARE integer_list

ASSIGN values to integer_list

//variable sum to hold the sum of the elements in the list

DECLARE sum

ASSIGN zero to sum

//loop through the integer_list and sum all it's elements together.

for(int i=0; i<integer_list.size(); i++){

sum += interger_list.get(i)

}

//Show the result of the addition from the for loop

DISPLAY "The sum is " + sum

Explanation:

The above code uses some hypothetical programming language syntax. The second and third lines declare an arbitrary integer list and assign a set of values to it respectively.  

The fifth line declares a variable "sum" which will hold the result of summing all the elements in the list. The sixth line initializes "sum" to zero.

The for loop shown iterates through the integer list cumulatively summing its elements.

The result is displayed as written on line 12.

Hope it helps!  

3 0
4 years ago
In which technique does a group rate or rank a set of information, compile the results and repeat until everyone is satisfied wi
garik1379 [7]
The correct option is DELPHI. Delphi technique is a structured and systematic method used in forecasting. The method often involve sending several rounds of questionnaires to experts. The anonymous responses are then gathered together and shared with the concerned group after each round of answers are received. 
5 0
3 years ago
Firewalls are categorized into two; namely hardware firewall and software firewall. Identify the correct statement for a softwar
garri49 [273]

Answer:

Option (d) Software firewall is placed between the normal application and the networking components of the operating system

Explanation:

  • Software Firewalls protect the computer from trojans and malicious content which can arise from unsafe applications.
  • It also protect the computer from external network.
  • It filters the data to and from a software application in the desktop.
  • It also filters the data to and from a network.
  • It safeguards the computer from not loosing access to the attackers.
  • It is customizable software and has to be monitored like installing updates and storage spaces etc.
  • Software Firewall in conjunction with the Hardware Firewall must be used for the security of the desktop and the networks.
5 0
3 years ago
What is the most efficient way to include a space after each paragraph
3241004551 [841]

To skip a line, then write the rest like this!


See? Good spacing, right?

4 0
3 years ago
Suppose that, when you arrive at the sale site for $50 Apple laptops (described in the text) at 1:45 A.M., you find more than 2,
const2013 [10]

Full question:

Suppose that, when you arrive at the sale site for $50 Apple laptops (described in the text) at 1:45 A.M., you find more than 2,000 people already waiting for the site to open. You turn around and go home to get some sleep. Later you buy an Apple laptop, the same model as the $50 one, for $1,070. This indicates that ________.

Answer:

your opportunity cost of waiting at the site (and pushing and shoving) is at least $1,020

Explanation:

If you had decided to stay and wait and go through the hassle of pushing and grabbing in the queue to get a laptop of $50, you would have saved $1020. This is an opportunity that you have not(forgone) used and so you pay for it in the form of increased price of the apple laptop at $1070.

6 0
3 years ago
Other questions:
  • Write a method swaparrayends() that swaps the first and last elements of its array parameter. ex: sortarray = {10, 20, 30, 40} b
    15·1 answer
  • The belief that the odds of two events occurring together are greater than the odds of either event occurring alone is the _____
    9·2 answers
  • Copy the main given below. Write the methods needed to produce the output given. YOU SHOULD NOT CHANGE MAIN
    10·1 answer
  • Which of the following is the 1's complement of 10?
    10·2 answers
  • If $350 is the profit of an initial investment of $1000.00, what is the percentage profit?​
    11·2 answers
  • Describe email etiquette and netiquette when communicating electronically.
    5·1 answer
  • Generally speaking, problems are rarely caused by motherboards. However, there are some instances in which a motherboard can fai
    12·1 answer
  • If you ship bakudeku. I swear. <br> *RANTS*
    11·1 answer
  • Which area located at the top of the word screen includes home , insert , and page layout ?
    13·2 answers
  • 5.9.5 Fibonacci <br><br> Y’all I’m struggling here do any of you have the code?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!