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
A photo's color intensity can be modified by changing the brightness and content.
fiasKO [112]
The above statement is FALSE.

A photo's color intensity can be modified by changing the brightness and CONTRAST.

There are four common image controls that makes an image easy to view. These controls are brightness, contrast, saturation, and sharpness.

Brightness control simply brightens the whole image from the shadows to the highlights equally.

Contrast control is the separation between the darkest and brightest areas  of the image.

Saturation control is the separation of colors in the image.

Sharpness control is defined as the edge contrast, meaning the edges in the image are the ones being contrasted.
6 0
3 years ago
Please help guys I'm so lost ​
PilotLPTM [1.2K]

Answer:

The correct answer is C ( W * 5 )

4 0
3 years ago
Read 2 more answers
"Use onblur and onfocus to add red borders to the input elements when the user leaves without any input, and a green border if a
strojnjashka [21]

Answer:

habla en español no te entiendo por favor

6 0
2 years ago
What should students hope to get out of classroom discussions? Check all that apply.
shtirl [24]

Answer:

well you didnt put the selection but i would guess answers help a good conversation

Explanation:

7 0
3 years ago
Read 2 more answers
leetcode A tourism company is providing boat tours on a river with n consecutive segments. According to previous experience, the
Soloha48 [4]

Answer:

OPT[i] : segment that end in i with largest amount N

OPT[0] = 0

OPT[i] = max{OPT[i-1] + ai, 0}

for i from 1 to n

if (OPT[i] > max) {

max = OPT[i]

max_i = i

}

count = 0

for i from max_i to 1

count +=a[i]

if (count== max) {

start = i ;

break;

}

3 0
3 years ago
Other questions:
  • If you know about 3D printers could you help me fix mine?
    8·1 answer
  • What software is typically used for larger systems?
    11·1 answer
  • You are asked to optimize a cache design for the given references. Th ere are three direct-mapped cache designs possible, all wi
    7·1 answer
  • Bluetooth © and Wifi are two examples of transmission protocols. Which of the following statements about them is true?
    9·1 answer
  • Given the following function definition
    13·1 answer
  • 1. Briefly explain the concept of signature of a function, in a function declaration. What signature components are crucial for
    9·1 answer
  • What is the worst case time complexity of insertion sort where position of the data to be inserted is calculated using binary se
    13·1 answer
  • 1) SuperFetch is a memory-management technique that a) determines the type of RAM your system requires. b) makes the boot-up tim
    7·1 answer
  • A data analyst adds descriptive headers to columns of data in a spreadsheet. How does this improve the spreadsheet?.
    8·1 answer
  • Describe the information technology industry today
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!