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
Sloan [31]
3 years ago
12

2.4 Code Practice: Question 2 Write a program that accepts a number as input, and prints just the decimal portion. Example: Ente

r a number: 15.789 Output: 0.789 Hint: Make sure to account for negative numbers!
Computers and Technology
1 answer:
vfiekz [6]3 years ago
6 0

Answer:

Explanation:

Let's code it using python. We can take care of the negative number by placing an absolute function at the end. Basically the decimal part is calculated by subtracting the integer part from the original input number

def decimal_print(number):

    int_part = int(number)

    decimal_part = number - int_part

    return abs(decimal_part)

You might be interested in
How did the tropica cyclone impact the environment​
Vilka [71]
Island dim disk disk dim sum
6 0
2 years ago
Does an android tablet have a hard drive
Kisachek [45]
No, it uses flash menory
3 0
3 years ago
A news website uses 32-bit integers to count the number of times an article has been viewed. The website is becoming more popula
Irina-Kira [14]

Answer:

2^32 times as many values can be represented

Explanation:

32-bit. This means that the number is represented by 32 separate one’s and zero’s. 32 bits of 2 possible states = 2^32=4,294,967,296 possible values.

Integer meaning that only whole multiples of one are accepted.

Signed meaning that negative values are accepted. This halves the number of possible positive values (roughly), so the largest number you can represent is 2^31–1=2,147,483,647, but instead of 0, the smallest number you can represent is -2,147,483,648. An unsigned 32-bit integer, by contrast, can represent anything from 0 to 4,294,967,295.

7 0
2 years ago
Leslie Is doing a sociological study of people who have live remote island. She interviews the people and than she observes them
dimulka [17.4K]
Making guesses, as opposed to the other answers, this is the only one that forges new ideas and doing such will only lead to an illegitimate conclusion/study.
5 0
3 years ago
Read 2 more answers
The top-level domain name of .com indicates that the website is
Ira Lisetskai [31]
C. commercial

is ur answer
5 0
3 years ago
Read 2 more answers
Other questions:
  • Normal view
    10·2 answers
  • Businesses have taken advantage of many of the smart phone features to promote their business. TRUE OR FALSE
    5·2 answers
  • Ports on the motherboard can be disabled or enabled in ____ setup. RAM Firmware Northbridge BIOS
    8·1 answer
  • Bit stream methods commonly use algorithm functions like the exclusive or operation (__________.
    11·1 answer
  • What are the pros and cons of editorial anonymity in Wikipedia
    10·2 answers
  • You're an administrator for a large corporation and you are responsible for deploying computers often and quickly. What server d
    10·1 answer
  • Which of the following statements is false? a. InputStream and OutputStream are abstract classes for performing byte-based I/O.
    7·1 answer
  • Assume phrase= "Peter Piper picked a peck of pickled peppers", What will be returned if phrase.search(/[aeiou]/) is called?
    9·1 answer
  • A nonprofit organization uses a contact management database to track donations, amounts donated, and all correspondence and phon
    11·1 answer
  • Please help!!!! will mark brainliest!!
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!