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
In the code snippet below, pick which instructions will have pipeline bubbles between them due to hazards.
denpristay [2]

Answer:

b. lw $t4, 4($t0)

c. add $t3, $t5, $t4

Explanation:

Pipeline hazard prevents other instruction from execution while one instruction is already in process. There is pipeline bubbles through which there is break in the structural hazard which preclude data. It helps to stop fetching any new instruction during clock cycle.

7 0
2 years ago
A software-based _________ is dedicated to examining and blocking internet traffic.
igomit [66]

A software-based <u>Firewall</u> is dedicated to examining and blocking internet traffic.

7 0
3 years ago
Read 2 more answers
Identify 3 distractions for young drivers and explain how you plan to minimize these distractions.
Rom4ik [11]
1 distraction is phones , texting and driving . They could have a system in their car which activated by a voice assistant who could do it al for them
4 0
3 years ago
Importancia de la química en la vida cotidiana​
maks197457 [2]

Answer:

chemistry is very important because everything you do is chemistry . our body is made up of chemicals . chemicals reactions occurs when be breathe ,eat , etc . All matter is made of chemicals so that chemistry is very important in our life

5 0
3 years ago
Do these devices allow you to view photos using the cloud?
ivann1987 [24]

Answer:

Yes, You can view the cloud on those devices

8 0
2 years ago
Other questions:
  • Which of the following components does a typical two stroke engine contain
    7·2 answers
  • In order for you to make a wireless connection it must first find an availble
    8·1 answer
  • What do you call the spreadsheet cell that is in effect and has a heavier black border around it?
    7·2 answers
  • Which of the following is most likely to include technical vocabulary?
    7·1 answer
  • What is a Hard Drive
    13·1 answer
  • A gas furnace has an efficiency of 75% . How many BTU will it produce from 1000 BTU of natural gas​
    14·2 answers
  • How do you make the "Colorize" feature in GIMP consistent if you cannot connect the different places? Brainliest if you also exp
    12·2 answers
  • 11. Explain different types of program control with suitable flow chart.<br> N
    15·1 answer
  • Create a new data frame, first_south, by subsetting titanic to include instances where a passenger is in the first class cabin (
    8·1 answer
  • A vlan ________.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!