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
ANTONII [103]
3 years ago
10

Create a recursive procedure named (accumulator oddsum next). The procedure will return the sum of the odd numbers entered from

the keyboard. The procedure will read a sequence of numbers from the keyboard, where parameter oddsum will keep track of the sum from the odd numbers entered so far and parameter next will (read) the next number from the keyboard.
Computers and Technology
1 answer:
maks197457 [2]3 years ago
8 0

Answer:

Explanation:

The following procedure is written in Python. It takes the next argument, checks if it is an odd number and if so it adds it to oddsum. Then it asks the user for a new number from the keyboard and calls the accumulator procedure/function again using that number. If any even number is passed the function terminates and returns the value of oddsum.

def accumulator(next, oddsum = 0):

   if (next % 2) != 0:

       oddsum += next

       newNext = int(input("Enter new number: "))

       return accumulator(newNext, oddsum)

   else:

       return oddsum

You might be interested in
Is the ability to choose the start and finish times, but they must complete a full day’s work
Hatshy [7]
Yes ma’am , can of spam. what she said up there ^*
4 0
3 years ago
Create java program for these 2 question
morpeh [17]

1 see what you can do and go from their

7 0
3 years ago
Sally needs to teach her class how to convert a decimal number to a binary number. What is the first step she should take to sta
Alborosie

<u>Answer:</u>

  • <em>A. divide the decimal number by the base value 2</em>
  • <em>C. note the remainder separately</em>
  • <em>D. divide by 2 until she gets 0 as the remainder</em>
  • <em>B. collect the digits in the reverse order</em>

<u>Explanation:</u>

When we want to convert decimal number to a binary number first we have divide the given number by 2. The next step is to note the reminder of the number in the side every division so that the reminder value is the binary value. Repeat this until an zero is encountered.

We have to collate all the remainders from last of first and then the collated number is the answer for the given problem.

<em>So the given option can be ordered as, </em>

  • <em>A</em>
  • <em>C</em>
  • <em>D</em>
  • <em>B</em>
6 0
4 years ago
What are 3 key factors in defining cost on cloud storage
gregori [183]

i'm not sure sorry

I hope someone else can help you with this question

3 0
3 years ago
DNS forwarding can be set up so that if the DNS server that receives the forwarded request cannot resolve the name, then the ser
hoa [83]

Answer:

Nonexclusive forwarding

Explanation:

In Nonexclusive forwarding, DNS forwarding is setup so that if the DNS server receiving the forwarded request cannot resolve the name, then the server that originally forwarded the request makes an attempt to resolves it. If that fails, the server sends a request to its designated forwarder.

8 0
3 years ago
Other questions:
  • What document is created to identify the areas of testing of a website?
    8·1 answer
  • How many megabytes of data can a factory made audio cd hold?
    13·1 answer
  • Which of the following statements about these signs is true?
    13·1 answer
  • What types of issues can you most likely resolve by knowing how to access and use the control panel choose all that apply?
    10·1 answer
  • How do you view a presentation as your audience would see it?
    14·2 answers
  • Can somebody help I need it now please and thank you correct answer please
    10·2 answers
  • Not every organization integrates with the Internet, but all use some or most of the technology that gave rise to it.
    15·1 answer
  • How communication skills are different from self management skills
    10·2 answers
  • What is the best example of how computers have changed the way people communicate?
    6·1 answer
  • based on your completed tables for ping requests and replies, which field do you think helps the network identify the appropriat
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!