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
kow [346]
4 years ago
13

The fractional_part function divides the numerator by the denominator, and returns just the fractional part (a number between 0

and 1). Complete the body of the function so that it returns the right number. Note: Since division by 0 produces an error, if the denominator is 0, the function should return 0 instead of attempting the division.
Computers and Technology
2 answers:
Luba_88 [7]4 years ago
5 0

Answer:

def fractional_part(numerator,denominator):

  if denominator == 0:

      return 0

  else :

      return (numerator/denominator)%1

Explanation:

m_a_m_a [10]4 years ago
5 0

Answer:

import math

def fractional_part(num, den):

   if den == 0:

      return 0

   return num / den - math.floor(num / den)

print(fractional_part(5,4)) // outputs 0.25

print(fractional_part(6,4)) // outputs 0.5

print(fractional_part(12,0)) // outputs 0

Explanation:

  • Using Python Programming Language:
  • Import math (Enables the use of the math.floor function)
  • Create an if statement to handle situations of denominator equals to zero
  • Dividing the floor (lower bound) of the numerator (num) by the denominator (den) and subtracting from the value of num / den gives the fractional part.
You might be interested in
Alright, don't judge me, this is a question that involves my Childhood game PvZ GW 2. So I noticed mods and stuff that get uploa
Ann [662]

Answer:

honnnestlyyy, you might have to y0utub3 it

7 0
3 years ago
Read 2 more answers
Differences between the first four generations of computers​
Lisa [10]
Hey man

The first generation computers were developed during 1943-1958. It used vacuum tubes as the active electronic components and was therefore very large. However some of the features are as follows-

a) They were extremely large and occupied a very large space.

b) They used vacuum tubes as memory device.

c) They were very expensive and consumed a lot of electrical power.

d) The operating speed was measured in milliseconds.

e) These computers had low level of accuracy and reliability.

f) Storage capacity was too small only 1 to 4Kb.

g) They used machine level programming language.

The examples are- UNIVAC, ENIAC, EDSAC, EDVAC, and UNIVAC.

The second generation computers were developed during 1959-1965. The invention of the transistor by three scientists of Bell Telephone Laboratories in 1947 greatly changed the development of computers. However some of the features are as follows-

a) These computers used transistor.

b) They were smaller, faster and cheaper than first generation of computer.

c) They consumed less electrical power than first generation.

d) The operating speed was measured in microseconds.

e) They were more reliable and accurate than the first generation computers.

f) They could understand high level language such as COBOL.

g) Magnetic tapes were used as secondary storage media.

The examples are – IBM 1620, IBM 1401, and CDC 3600.

The third generation computers were developed during 1966-1973. The development of Integrated Circuit (IC) signaled the beginning of the third generation computers. However some of the features are as follows-

a) These computers used integrated circuits.

b) They were small, efficient and reliable.

c) Operating systems were developed.

d) Monitors and keyboards were introduced for input and output of data.

e) Magnetic disks were used for secondary storage.

f) The operating speed was measured in nano seconds.

g) They could understand large number of high level languages.

The examples are – IBM 360, ICL -1900, and IBM 370 etc.

The fourth generation computers were developed during 1974-1990. This generation of computer is presently in use. The development of microprocessor signaled the beginning of the fourth generation of computers. However some of the features are as follows-

a) These computers use LSI and VLSI technologies.

b) Its sizes were reduced to desktop and laptop computer.

c) These computers are highly reliable and accurate.

d) They have a large memory and high functional speed.

e) The operating speed is measured in beyond picoseconds and MIPS (Million of instruction per second)

f) Magnetic disk is the common source of external storage.

g) Multiprocessing and multiprogramming OS (operating system) are used.

h) 4GL are also used.

The examples are – IBM PC, Apple/Macintosh, 8086, 80286 SX, 80386 SX etc.

The computers having artificial intelligence (AI) and high processing capacity undergoing on the development stage from 1990 are said to be fifth generation computers. However some of the features are as follows-

a) The speed will be extremely high in fifth generation computer.

b) These computers will be using Ultra Large Scale Integration (ULSI) technology.

c) The goal of fifth generation computers is to develop machines that will be able to think and take decisions.

d) It can perform large number of parallel processing.

e) Biochips and Gallium Arsenide (GaAS) will be used as memory devices.

f) Large uses of natural language processing and user friendly.

Able to make decisions like human beings.
4 0
3 years ago
Which component of a computer is its input device and what role does it play in a document?
hichkok12 [17]

a keyboard is a imput device that helps in writing in a document.

3 0
4 years ago
______design A plan for the actual implementation of the system.
Stella [2.4K]

Answer:

please

Explanation:

6 0
4 years ago
Read 2 more answers
Plane eyes I don't know
FrozenT [24]
IFLY is probably what it was.
3 0
3 years ago
Other questions:
  • Microsoft windows server and linux are examples? of:
    12·1 answer
  • When a process becomes digital, it often becomes cheaper and the workflow becomes simpler. True False
    5·2 answers
  • What is Deep learning
    9·1 answer
  • Some have argued that Unix/Linux systems reuse a small number of security features in many contexts across the system, while Win
    12·1 answer
  • What is netiquettes?. Mention any 4 netiquettes. (for class 6)​
    5·1 answer
  • Jared has trouble remembering when his assignments are due, and he wants to keep reminders on his computer. Which online note-ta
    10·2 answers
  • g Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a num
    7·1 answer
  • int FindFirstCharFrom(char* str, char *sought); The function FindFirstCharFrom takes pointers to two C strings as arguments, str
    13·1 answer
  • Why should you list more than one font if you are formatting some text using CSS?
    10·1 answer
  • What is a monitor?<br>i can ask everyone ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!