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
ch4aika [34]
3 years ago
13

Write a program that takes a decimal number from the user and then prints the integer part and the decimal part separately. For

example, if the user enters 2.718, the program prints: Integer part = 2 and decimal part = .718 in python
Computers and Technology
1 answer:
svp [43]3 years ago
7 0

Answer:

Explanation:

The following was coded in Python as requested. It is a function that takes in a number as a parameter. It then uses the Python built-in math class as well as the modf() method to split the whole number and the decimal, these are saved in two variables called frac and whole. These variables are printed at the end of the program. The program has been tested and the output can be seen below.

import math

def seperateInt(number):

   frac, whole = math.modf(number)

   print("Whole number: " + str(math.floor(whole)))

   print("Decimals number: " + str(frac))

You might be interested in
Write the function evens which takes in a queue by reference and changes it to only contain the even elements. That is, if the q
kvv77 [185]

Answer:

Explanation:

The following code is written in Java it goes through the queue that was passed as an argument, loops through it and removes all the odd numbers, leaving only the even numbers in the queue. It does not add any more data structures and finally returns the modified queue when its done.

  public static Queue<Integer> evens(Queue<Integer> queue) {

       int size = queue.size();

       for(int x = 1; x < size+1; x++) {

           if ((queue.peek() % 2) == 0) {

               queue.add(queue.peek());

               queue.remove();

           } else queue.remove();

       }

       return queue;

   }

3 0
2 years ago
Why is dark supereffective against ghost?
Mice21 [21]

Answer:

hmmmmm...hold up let me look up what dark supereffective means XD...

Explanation:

?oh so i only see stuff about pokemon so id imagine its about that...

4 0
3 years ago
Read 2 more answers
// Exercise 4.16: Mystery.java
nignag [31]

Answer:

385

Explanation:

There was no question so I simply run the program for you and included the output.

The program seems to calculate: \sum\limits_{x=1}^{10} x^2

8 0
2 years ago
Given a typical magnetic hard drive with five platters, answer the following:
Nataly_w [17]

Answer:

Given the number of platters =5

A. Hence, the number of recording surface =10

B. number of read-write heads =10

C. Number of arms holding the read-write heads = 10

Explanation:

We know that number of recording surface = 2 *( number of platters)

= 2*5=10

And the number of read-write heads = number of recording surface= 10

Also, number of arms holding the read-write head = one for each read-write head= 10

And hence, the above answer.

5 0
3 years ago
CLS
marusya05 [52]

Answer:

1 1

2

3

5

8

13

21

34

55

Explanation:

i guess this is the answer

8 0
2 years ago
Other questions:
  • Productivity software has been used for a number of years. Recent advancements in productivity software technology have made ___
    14·1 answer
  • Which windows tools would you use to browse the files system on a hard drive?
    6·2 answers
  • Write a function called lucky_sevens that takes in one #parameter, a string variable named a_string. Your function #should retur
    15·1 answer
  • Describe some ways that you personally use information technologies differently than you did just a few years ago
    11·1 answer
  • What are pixels? A. Objects that are part of a particle system B. Tiny colored dots that make up images and text on a computer s
    9·1 answer
  • Why laptop computer is called micro computer?​
    8·1 answer
  • list = 7 # these many modified Fibonacci numbers. def fibonacci_gt(n, t1, t2): if n&lt;0: print("Incorrect input") elif n == 0:
    12·1 answer
  • H e l p ASAP plz <br> and thanks
    9·1 answer
  • PLS REPLY ASAP WILL MARK BRAINLIEST
    5·2 answers
  • Why does Homework exist? Why is it so important?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!