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
Butoxors [25]
2 years ago
8

Write a function statement() that takes as input a list of floating-point numbers, with positive numbers representing deposits t

o and negative numbers representing withdrawals from a bank account. Your function should return a list of two floating-point numbers, the first will be the sum of the deposits, and the second (a negative number) will be the sum of the withdrawals.
Computers and Technology
1 answer:
katrin2010 [14]2 years ago
5 0

Answer:

def statement(numbers):

   deposits = []

   withdrawals = []

   for number in numbers:

       if number > 0:

           deposits.append(number)

       if number < 0:

           withdrawals.append(number)

   

   return [sum(deposits), sum(withdrawals)]

Explanation:

*The code is in Python.

Create a function called statement that takes numbers as a parameter

Inside the function, create two empty lists called deposits and withdrawals. Create a for loop that iterates through the numbers. Inside the loop, if a number is greater than 0, add it to the deposits. If a number is smaller than 0, add it to the withdrawals. When the loop is done, return the sum of the deposits and the sum of the withdrawals (use sum function to sum the numbers in the lists)

You might be interested in
Which of the following is not a shared characteristic of new media.
tensa zangetsu [6.8K]
The last one , info is not sparse or little , we have plenty of it
6 0
3 years ago
Explain four features of presentation packages​
hichkok12 [17]
You have add more for anyone to be able to answer this, sorry
4 0
2 years ago
How do you fix peer answer bad gateway 502. Please help
kondaur [170]

Answer:

Reload the page.

Look for server connectivity issues.

Check for any DNS changes.

Sift through your logs.

Fix faulty firewall configurations.

Comb through your website's code to find bugs.

Contact your host.

Explanation:

7 0
3 years ago
Object-Oriented Programming (Using Java Language)
Delicious77 [7]

Answer:

import java.util.Scanner;

class Main {  

 public static void main(String args[]) {

       Scanner scan = new Scanner(System.in);

       System.out.print("Enter a decimal value (0 to 15): ");

       int num = scan.nextInt();

       scan.close();

       

       if (num < 0 || num >15) {

           System.out.printf("%d is an invalid input\n", num);

       } else {

           System.out.printf("The hex value is %X\n", num);

       }

 }

}

Explanation:

Hopefully this example will get you going for the other assignments.

3 0
2 years ago
Which of the following is not an operating system
mrs_skeptik [129]

Answer:

C

Explanation:

I hope this helped.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • What list did poe appear on for the search engine lycos?
    11·1 answer
  • Respecting culture in the workplace means understanding that
    5·2 answers
  • A server would experience a __________ attack when a hacker compromises it to acquire information from it from a remote location
    13·1 answer
  • What is a parameter variable?
    8·1 answer
  • Write the function header (the first line of the function definition) to define a function named DisplayStats that accepts a str
    5·1 answer
  • In a gear system, when you gain torque you lose what?
    11·1 answer
  • If you set the Decimal Places property to 0 for a Price field, and then enter 750.25 in the field, what does Access display in t
    5·1 answer
  • Zara wants to create some lines of code that are ignored by the computer. What should these lines begin with?
    5·1 answer
  • What does an arrow after a command indicate
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!