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
jeka94
3 years ago
8

In this challenge, write a function to add two floating point numbers. Determine the integer floor of the sum. The floor is the

truncated float value, i.e. anything after the decimal point is dropped. For instance, floor(1.1 + 3.05) = floor(4.15) = 4.
Computers and Technology
1 answer:
Wewaii [24]3 years ago
5 0

Answer:

def floor_sum(number1, number2):

   total = number1 + number2

   if total >= 0:

       return int(total)

   else:

       return int(total) - 1

   

print(floor_sum(1.1, 3.05))

Explanation:

*The code is in Python.

Create a function called floor_sum that takes two parameters, number1 and number2

Sum them and set it to the total

Check if the total is positive number or 0, return the integer part of the total. Otherwise, subtract 1 from the integer part of the total and return it.

Call the function with given parameters in the question and print the result

Note that if the result is a negative value like -5.17, the floor of the result is -6 not -5.

You might be interested in
Els
galina1969 [7]

Answer:

ds2d2d2d2dd

Explanation:

3 0
2 years ago
Write a program that reads the balance and annual percentage interest rate and displays the interest for the next month. Python
denis23 [38]

Answer:

Explanation:

The following code is written in Python. It asks the user to enter the current balance and the annual interest rate. It then calculates the monthly interest rate and uses that to detect the interest that will be earned for the next month. Finally, printing that to the screen. A test output can be seen in the attached picture below.

balance = int(input("Enter current Balance: "))

interest = int(input("Enter current annual interest %: "))

interest = (interest / 12) / 100

next_month_interest = balance * interest

print('$ ' + str(next_month_interest))

7 0
2 years ago
Which term refers to actions that you would typically perform on a computer to revive it even if it functions in an unexpected m
sweet-ann [11.9K]
You'd usually reboot a PC if it malfunctions.
6 0
2 years ago
Which sns gets its names from one of its unique features
Komok [63]

Answer:

no

Explanation:

3 0
3 years ago
Name and define (or list the set that defines) three of the four common data types in programming.
Dominik [7]

Answer: this is the  Answer your question

6 0
2 years ago
Other questions:
  • Do most facebook and twitter users access the platform from their personal computers?
    6·2 answers
  • A bookmarking site is a website that enables members to manage and share media such as photos, videos, and music. true or false
    14·1 answer
  • The superclass Calculator contains: a protected double instance variable, accumulator, that contains the current value of the ca
    5·1 answer
  • Super easy question but you have to think about it because it’s not that easy I’ll mark brainliest for first answer Explain the
    11·1 answer
  • What is the color difference between the iMac and iMac Pro
    14·2 answers
  • Portable Document Format (PDF) is a file format that provides an electronic image of a document and can be viewed, printed, and
    12·2 answers
  • Which science topics would be suited for this organizational aid? Check all that apply.
    11·1 answer
  • Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right or left. Initially, the bu
    7·1 answer
  • Make this be a 7th grade argument over a boy
    5·2 answers
  • When defining a system
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!