subject

2.4 Code Practice: Question 2 Write a program that accepts a number as input, and prints just the decimal portion. Your program should also work if a negative number is inputted by the user.

Sample Run
Enter a number: 15.789
Sample Output
0.789
Hints:
You'll likely need to use both the int() and float() commands in your program.
Make sure that any number the user inputs is first stored as a float.
You'll need to use at least two variables in your program: one that stores the original value entered by the user, and one that represents the integer value entered by the user.
These two variables can be subtracted from one another, to leave just the decimal portion remaining.
Don't forget to have your program print the decimal portion at the end!

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
What is a distinguishing feature of today’s graphic application software?) graphic applications are used today on a variety of devices, including touch-screen kiosks and mobile phones.
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
Which of these is an example of an integrated presentation? a. a table created in powerpoint b. an image pasted into powerpoint c. a caption created in powerpoint d. an excel chart pasted into powerpoint
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
question
Computers and Technology, 24.06.2019 23:00
Hypertension occurs when blood pressure is too high.
Answers: 1
You know the right answer?
2.4 Code Practice: Question 2 Write a program that accepts a number as input, and prints just the d...
Questions
question
Mathematics, 19.09.2019 13:20
question
Social Studies, 19.09.2019 13:20
question
Mathematics, 19.09.2019 13:20
Questions on the website: 13722367