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]
4 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]4 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
What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
Ainat [17]

Answer: Even though the hardware is inexpensive the writing of program is not efficient through this method as proper development of program is necessary for the clear execution due to factors like:-

  • The facility of writing program even the cost of hardware is less but it is not a free facility.
  • It also has a slower processing for the execution of the program
  • The construction of the efficient program is necessary for the compilation and execution of it rather than poorly constructed program is worthless and inefficient in working.

7 0
3 years ago
that average july high temperature is 85 degrees fahrenheit in new york, 88 degrees fahrenheit in denver, and 106 degrees fahren
goblinko [34]

Answer:

public class num8 {

   public static void main(String[] args) {

       System.out.println("Average Temperature in New York is 85 degrees fahrenheit");

       System.out.println("Average Temperature in Denver is 88 degrees fahrenheit");

       System.out.println("Average Temperature in Phoenix is 106 degrees fahrenheit");

   // Calculating the new average Temperatures

       System.out.println("The New Average Temperature in New York " +

               "is "+ ((0.02*85)+85 )+ " degrees fahrenheit");

       System.out.println("The New Average Temperature in Denver " +

               "is " +((0.02*88)+88 )+ " degrees fahrenheit");

       System.out.println("The New  Average Temperature in Phoenix " +

               "is "+((0.02*106)+106 )+ " degrees fahrenheit");

   }

}

Explanation:

  1. Using Java first display the previous average temperatures for the three cities as given in the question
  2. Then calculates the new average temperature by multiplying by 0.02, because of a 2 percent increase in the average temperature
  3. Display the new temperature using the System.out,println

8 0
3 years ago
8.9 Lesson Practice edhesive
lapo4ka [179]
Is what it is so it can’t be what it isn’t
6 0
3 years ago
Read 2 more answers
What important information is added to the TCP/IP transport layer header to ensure communication and connectivity with a remote
kramer

Answer:

<em>Source port numbers and Destination </em>

Explanation:

Sockets are also <em>known as the source and destination IP addresses are combined with the  source and destination port numbers.  </em>

The socket is used to define the client's request for server and network.  

Thousands of hosts are communicating with millions of separate servers every day.

5 0
4 years ago
What are all the possible 4-digit codes you can make with the numbers 7, 0, 9, and 3?
Arte-miy333 [17]
0,7,0,0
9,9,0,0
7,7,7,7
3,9,0,7

Hope this helps
4 0
3 years ago
Read 2 more answers
Other questions:
  • The process of analyzing data to extract information not offered by the raw data alone; it uncovers trends and patterns using te
    6·1 answer
  • The variety of theatre introduced in the 1960s that denotes semi-professional or even amateur theatre in the New York/Manhattan
    11·1 answer
  • How can you exaggerate the height of a jump in a photograph
    10·1 answer
  • A security manager has discovered that sensitive information stored on a server has been compromised. The organization is requir
    7·1 answer
  • You can include up to _____ logical conditions in the and function. (487181)
    12·1 answer
  • WILL GIVE BRAINLIEST
    5·2 answers
  • Describe how computer are used in ticket counter?​
    10·1 answer
  • Which of the following screen elements is a horizontal bar that displays at the
    8·1 answer
  • What level of system and network is required for cui
    7·1 answer
  • Need help completing this coding assignment.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!