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
Formulas should follow the___
tatuchka [14]

Answer:

Order of operations

Explanation:

4 0
2 years ago
* 8) Embedded operating systems are specialized software meant only to manage the
Ede4ka [16]

Answer:

True

Explanation:

Embedded operating systems are operating systems which supports hardware which is not a computer and allows the hardware to perform its task.

An example of a device with an embedded operating system is an SD card. The operating system on the card allows the card to be readable by the computer which its is plugged to.

Other examples of hardware with embedded systems are traffic lights, digital televisions, ATMs, point of sale (POS) and digital cameras.

3 0
3 years ago
int) You are the head of a division of a big Silicon Valley company and have assigned one of your engineers, Jim, the job of dev
sergeinik [125]

Answer:

Correct option is E

Explanation:

a) 2n^2+2^n operations are required for a text with n words

Thus, number of operations for a text with n=10 words is 2\cdot 10^2+2^{10}=1224 operation

Each operation takes one nanosecond, so we need 1224 nanoseconds for Jim's algorithm

b) If n=50, number of operations required is 2\cdot 50^2+2^{50}\approx 1.12589990681\times 10^{15}

To amount of times required is 1.12589990681\times 10^{15} nanoseconds which is

1125899.90685 seconds (we divided by 10^{9}

As 1$day$=24$hours$=24\times 60$minutes$=24\times 60\times 60$seconds$

The time in seconds, our algortihm runs is \frac{1125899.90685}{24\cdot 60\cdot 60}=13.0312 days

Number of days is {\color{Red} 13.0312}

c) In this case, computing order of number of years is more important than number of years itself

We note that n=100 so that 2(100)^2+2^{100}\approx 1.267650600210\times 10^{30} operation (=time in nanosecond)

Which is 1.267650600210\times 10^{21} seconds

So that the time required is 1.4671881947\times 10^{16} days

Each year comprises of 365 days so the number of years it takes is

\frac{1.4671881947\times 10^{16}}{365}=4.0197\times 10^{13} years

That is, 40.197\times 10^{12}=$Slightly more than $40$ trillion years$

4 0
3 years ago
NEED HELP NOW 66 POINTS WILL MARK BRAINLIEST!! For the independent reading all you have to do is pick a grade six book that you
nlexa [21]
1a
2a
3b
4d
5c
6d
7b
8c
9a
10c
6 0
3 years ago
What is a circuit breaker and how is it different from a fuse? Why do we need these two different devices?
Liula [17]

Answer:

Circuit breakers and fuses both have the same purpose, but a fuse will melt when stopping electricity where as circuit breakers can just be reset. You need both devices in order to stop a overload of power that could fry your electronics or worse, start fires.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Where is the error in this code sequence?
    11·1 answer
  • Mention five features of word processing application​
    10·1 answer
  • Identify the computer cycle in each of the descriptions below by choosing the answer from the
    12·1 answer
  • Which of the following is a narrative essay most like?
    10·2 answers
  • This method of advertising is expensive but can be the most effective method.
    15·1 answer
  • As defined by the National Institute of Standards and Technology​ (NIST), "________ is a model for enabling​ ubiquitous, conveni
    11·1 answer
  • How are comments in a Java program treated by the compiler?
    14·2 answers
  • 4. In paragraph 7, what is the meaning of the phrase "not
    13·1 answer
  • What is the best way to pay for college?
    9·2 answers
  • Finish the format string to get the output shown below.<br> Day<br> &gt;&gt;&gt;{ v8'_format('Day)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!