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
Some computer engineering students decided to revise the LC-3 for their senior project. In designing the LC-4, they decided to c
Bezzdna [24]

Some computer engineering students decided to revise the LC-3 for their senior project.  KBSR and the DSR into one status register: the IOSR (the input/output status register). IOSR[15] is the keyboard device Ready bit and IOSR[14] is the display device Ready bit can be done in LC-3.

LC-4 is a poor design.

Explanation:

LC-3, is a type of computer educational programming language, an assembly language, which is a type of low-level programming language.

It features a relatively simple instruction set, but can be used to write moderately complex assembly programs, and is a theoretically viable target for a C compiler. The language is less complex than x86 assembly but has many features similar to those in more complex languages. These features make it useful for beginning instruction, so it is most often used to teach fundamentals of programming and computer architecture to computer science and computer engineering students.

The LC-3 specifies a word size of 16 bits for its registers and uses a 16-bit addressable memory with a 216-location address space. The register file contains eight registers, referred to by number as R0 through R7. All of the registers are general-purpose in that they may be freely used by any of the instructions that can write to the register file, but in some contexts (such as translating from C code to LC-3 assembly) some of the registers are used for special purposes.

When a character is typed:

  • Its ASCII code is placed in bits [7:0] of KBDR  (bits [15:8] are always zero)
  • The “ready bit” (KBSR[15]) is set to one
  • Keyboard is disabled -- any typed characters will be ignored

When KBDR is read:

  • KBSR[15] is set to zero
  • Keyboard is enabled
  • Alternative implementation: buffering keyboard input
8 0
3 years ago
A person's oral communication skills can give either a positive or negative first impression.
ratelena [41]

Answer:

true

Explanation:

oral communication can be awkward or good.

5 0
2 years ago
Which best describes a difference between transcription and DNA replication
ruslelena [56]
DNA replication is just making a copy of someone or somethings DNA
6 0
2 years ago
Read 2 more answers
What does it mean to clear a setting in a dialog box?
yaroslaw [1]

Answer:

to delete it

Explanation:

5 0
2 years ago
Many major employers routinely monitor the performance of their employees through the computers and telephones they use. Employe
STALIN [3.7K]

Answer:

Employers are allowed to check the number of keystrokes that word processors enter during the day.

Explanation:

An employer is authorized to monitor the activity of its employee when:

  • The employee authorizes it.
  • The employer owns the system to be used.
  • Surveillance is necessary for a strictly professional purpose.

By analyzing the keys pressed per day, the employer can determine the performance provided by its employees, and if they use the company's resources, for non-work purposes.

5 0
3 years ago
Other questions:
  • Computers store temporary Internet files in the Recycle Bin. These files take up space and slow down a computer. Which tool can
    10·1 answer
  • In the history of Social Media what are two points that stood out?
    12·1 answer
  • I will upvote....
    10·1 answer
  • Arctic Gear LLC. recently adopted a new ERP​ system, but quickly found that it​ wasn't a perfect fit with their existing procedu
    14·1 answer
  • Xavier buys a new laptop for $540. He makes a down payment $75 and pays the rest in 6 equal monthly payments, p. What equation r
    7·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • Answer This One Question Right For Brainliest
    10·1 answer
  • Privacy, anonymity, and freedom of expression are all interrelated.
    12·1 answer
  • Could you tell me the family link app code to unlock a phone please?
    13·1 answer
  • What dictionary operation can you use to remove all the keys within the dictionary-named contacts?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!