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
tangare [24]
3 years ago
8

Lists and Procedures Pseudocode Practice For each situation, provide a pseudocoded algorithm that would accomplish the task. Mak

e sure to indent where appropriate. Situation A Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint: use Mod). Displays the sum. Situation B Write a procedure that takes
Computers and Technology
1 answer:
Andrei [34K]3 years ago
6 0

Answer:

The pseudocoded algorithm is as follows:

Procedure sumOdd(lotsOfNumbers):

    oddSum = 0

    len = length(lotsOfNumbers)

    for i = 0 to len - 1

         if lotsOfNumbers[i] Mod 2 != 0:

              OddSum = OddSum + lotsOfNumbers[i]

Print(OddSum)

Explanation:

This defines the procedure

Procedure sumOdd(lotsOfNumbers):

This initializes the oddSum to 0

    oddSum = 0

This calculates the length of the list

    len = length(lotsOfNumbers)

This iterates through the list

    for i = 0 to len-1

This checks if current list item is odd

         if lotsOfNumbers[i] Mod 2 != 0:

If yes, the number is added to OddSum

              OddSum = OddSum + lotsOfNumbers[i]

This prints the calculated sum

Print(OddSum)

You might be interested in
Which of the following is a key component to your individual internet safety? government regulations
nexus9112 [7]
It is government regulations and acceptable use policy
3 0
3 years ago
If you are trying move a hard drive from a non-working computer to a working computer for the purposes of accessing the data on
Llana [10]
You must have an administrator password before you can access the drive <span />
5 0
3 years ago
Oliver is creating an image of a fruit basket. From the basket, he wants the red apples to stand out among the rest so they will
Volgvan
He   can increase   the   thickness   of the paint on the   apples.
Or he can  use glossier  finish on the   apples  to make them stand out...
3 0
4 years ago
How to play Drinkopoly game?
professor190 [17]
Answer:
Never heard of that lol
3 0
3 years ago
Find out the names of at least 20 programming languages and their developers.
arlik [135]

Answer:

lala

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Waterpower was first harvested by ancient societies using
    5·1 answer
  • Tim has an old server computer that his company uses as a backup. One of the hard drives has gone bad and needs to be replaced.
    13·1 answer
  • If in your checkout cart right before you buy something there is an option saying "this order contains a gift." on amazon, what
    7·1 answer
  • Consider the following C code fragment:
    10·1 answer
  • Blank spaces or unseen control characters in a data file are referred to as
    5·2 answers
  • He flow of electric charges through a material describes an electric _______.
    10·1 answer
  • How can i fix a all white phone screen
    11·2 answers
  • What are some best practices for file management
    8·1 answer
  • Write a program that removes all non-alphabetic characters from the given input.
    7·1 answer
  • Question 12 (5 points)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!