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
lbvjy [14]
3 years ago
11

Given two int variables distance and speed, write an expression that divides distance by speed using floating point arithmetic,

i.e., a fractional result should be produced. (NOTE: Simply write an expression that performs the calculation. Do not assign the result to a variable.)
Computers and Technology
1 answer:
Vsevolod [243]3 years ago
7 0

Answer:

float(distance) / speed

Explanation:

Given the variable <em>distance</em> and <em>speed</em> in a program that hold a integer value respectively.  We can perform the division between the two variable using / operator. Since both distance and speed are integers, we need to convert one of them to float type to perform the floating point arithmetic. Otherwise the division output will be rounded up to the nearest integer which is not a desired result.

You might be interested in
Analizar los componentes de una computadora completa hoy en día comparada con el inicio de la Informática.
scZoUnD [109]

Answer:

Explanation:

Las computadoras que existian en el inicio de la informatica y las que existen ahora tenian los mismos componentes. Estos eran CPU, Placa Madre, RAM, HDD, y tarjeta grafica. Lo que si cambio fueron el velocidad y capacidad. Por ejemplo, en el inicio las Tarjetas de RAM venian como DDR a una velocidad maxima de 133 Mhz con una capacidad de entre 4mb y 8mb. Hoy en dia tenes RAM de DDR5 con una velocidad de 4400 Mhz y de 8gb. Mientras que avanzaba el tiempo los componentes de las computadoras aumentaban en velocidad y capacidad aunque el tamaño bajaba o aumentaba dependiendo del gusto del usario.

8 0
3 years ago
. Java is a high-level language.. true or false?
frutty [35]

Answer:

the answer is true. it is a high level language

4 0
3 years ago
Whers the main characteristic of a Peer-to-peer (P2P) network?
ioda

The answer to this would be B

5 0
3 years ago
Computers are not just stand-alone desktop machines anymore. They are often embedded in common appliances and technology that we
Mila [183]
A DVD does not have a computer in it.
4 0
3 years ago
Read 2 more answers
Write a program that asks the user to input a positive integer and then calculates and displays the factorial of the number. The
mestny [16]

Answer:

<em>The program is written in python and it doesn't make use of any comment; </em>

<em>(See explanation section for line by line explanation)</em>

def getN(num):

     fact = 1

     for i in range(1, 1 + num):

           fact = fact * i

     print("Factorial: ",fact)

num = int(input("Number: "))

if num < 0:

     print("Invalid")

else:

     getN(num)

Explanation:

The function getNum is defined here

def getN(num):

Initialize the result of the factorial to 1

     fact = 1

Get an iteration from 1 to the user input number

     for i in range(1, 1 + num):

Multiply each number that makes the iteration

           fact = fact * i

Print result

     print("Factorial: ",fact)

Ths line prompts user to input number

num = int(input("Number: "))

This line checks if user input is less than 0; If yes, the program prints "Invalid"

if num < 0:

     print("Invalid")

If otherwise, the program calls the getN function

else:

     getN(num)

6 0
3 years ago
Other questions:
  • The _________ specifies the station(s) for which the frame is intended. it may be a unique physical address, a group address, or
    5·1 answer
  • Casual or informal group meetings are common. Here youcasually chat over tea, meet after work, or get together for purelysocial
    5·1 answer
  • How many different integers can be represented with a 4-digit number in base 13?
    8·1 answer
  • Explain the use of keyboard shortcuts and key combinations. You are at the tenth page of a 20-page document. You need to make ch
    14·1 answer
  • Jim is in the market for a car that will last for the next 10 years and has saved up some money for the purpose of a car. What’s
    8·2 answers
  • What does “human-like” mean when we are talking about a machine?
    7·1 answer
  • What are the three control statements in Qbasic?​
    10·1 answer
  • Anyone else having problems with edg?
    9·1 answer
  • What does the asterisk (*) after select tell the database to do in this query?
    6·1 answer
  • What is the accurate description
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!