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
You can drag a cell to a new location by pointing to the cell border until the pointer displays a _______ arrow, and then draggi
Marina CMI [18]

The answer for the blank space given in the question is a type of arrow called four-headed arrow.

Four-headed arrow can be found in many computer software and applications, including in Microsoft Excel. Generally, <u>it is used to move an object from one place to another.</u> In the given scenario described at the question, it is used to move a cell from one location to another.

3 0
2 years ago
Read 2 more answers
If you Buy my group clothing in R.o.b.l.o.x for a donation i will make you brainliest
erastova [34]

Answer:kk ima do it

Explanation:

7 0
3 years ago
Read 2 more answers
____ map a set of alphanumeric characters and special symbols to a sequence of numeric values that a computer can process.
Neporo4naja [7]
The answer is : coding schemes
4 0
3 years ago
consider the following code segment, which appears in a method in a class other than password. the code segment does not compile
Romashka [77]

The code segment does not compile because the method 'reset' does not return a value that can be displayed.

A method refers to a block of that which only runs when it is called. It is permissible to pass data, referred to as parameters, into a method. Methods are used to accomplish certain actions, and they are also called functions. As per the given code segment that appears as a method in a class, it does not compile because the method named 'reset' is not returning a value that can be printed on the screen as an output.

"

<em>Complete question:</em>

Consider the following code segment, which appears in a method in a class other than password.

Password p = new Password("password");

System.out.println("The new password is " + p.reset("password"));

The code segment does not compile because _____________ .

"

You can learn more about Method at

brainly.com/question/27415982

#SPJ4

4 0
9 months ago
(e) The vending machine stores the quantity of items available in a database table called ITEMS
zimovet [89]

Answer:

a1,a2,62,

please mark brainliest

Explanation:

8 0
2 years ago
Other questions:
  • Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being
    14·1 answer
  • What exactly is a byte? A byte is a term that is short for binary digit. 8 bytes hold about one letter, one number, or one speci
    10·1 answer
  • Which of the following tasks would a database administrator perform ? A identify computer security photos, B. Make sure protocol
    15·1 answer
  • PASSAGE: The picnic had been scheduled for weeks in advance. The Morris family was looking forward to some fun and relaxation wi
    12·1 answer
  • What is meant by encapsulating semaphores? Bring out the need for it
    12·1 answer
  • To close the ____ view, click File on the Ribbon or click the preview of the document in the Info gallery to return to the docum
    9·1 answer
  • What code do I have to use in my php if i don’t want my $_SESSION[“variablex”] to destroy? But i already have a session_destroy(
    6·1 answer
  • Select the correct answer.
    13·2 answers
  • Which of the following statements are true about file naming conventions? Check all of the boxes that apply.
    7·2 answers
  • Write a program to sort the (name, age, score) tuples by descending order where name is string, age and score are numbers. The s
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!