Question

5. Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance write program in java
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1:


public class FallingDistance {
   public static void main(String[] args) {
      
       for(int i=1;i<10;i++)
           System.out.println(getDistance(i));
   }

   private static double getDistance(double t) {
       return 0.5 * 9.8 * t *t;
   }
}

3 public class FallingDistance { 4C public static void main(String [] args) { 5 for (int i-1;i<10; i++) System.out.println (g

Answer 2:


public class Temparature {
   public static void main(String[] args) {
       for(int i=0;i<200;i++)
       System.out.printf("%d\t%.2f\n",i,centigrade(i));
   }

   private static double centigrade(int a) {
       return 5.0/9 * (a-32);
   }

}

-17.78 0 1 -17.22 2 -16.67 -16.11 -15.56 5 -15.00 6 -14.44 7 -13.89 -13.33 -12.78 10 -12.22 11 -11.67 -11.11 12 13 -10.56 14

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
write program in java 5. Falling Distance When an object is falling because of gravity, the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PYTHON HOMEWORK When an object is falling because of gravity, the following formula can be used...

    PYTHON HOMEWORK When an object is falling because of gravity, the following formula can be used ot determine the distance the object falls during a specific time period: d=1/2 g t^2 The variables in the formula are as follows: d is the distance in meters(m), g is the acceleration due to gravity, an and its value is 9.8 m/s^2, t is the time duration in seconds(s). Write a function named falling_distance() that accepts an object's falling duration(time) in seconds as...

  • When an object is falling because of gravity, the following formula can be used to determine...

    When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d=1/2 gt^2 The variables in the formula are as follows: d is the distance, g is 9.8, and t is the amount of time that the objects has been falling. Write a soldier method that accepts an object’s falling time as an argument. The method should return the distance that the object has fallen...

  • C++ LANGUAGE The following formula can be used to determine the distance an object falls in...

    C++ LANGUAGE The following formula can be used to determine the distance an object falls in a specific time period: d = 1 2 g t 2 where d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, the object has been falling. Write a function named fallingDistance that accepts an object's falling time in seconds as an argument. You must define a named constant for g using a meaningful name and...

  • 7. Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is the...

    7. Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is the Fahrenheit temperature and C is the Celsius temperature. Write a func- he func- tion named celsius that accepts a Fahrenheit temperature as an argument. I tion should return the temperature, converted to Celsius. Demonstrate t he function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.

  • C++ Code needed    Celsius Temperature Table The formula for converting a temperature from Fahrenheit to...

    C++ Code needed    Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is C =5/9(F -32) where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.

  • Do not prompt the user for input during the execution of your program. Do not pause...

    Do not prompt the user for input during the execution of your program. Do not pause at the end of the execution waiting for the user's input. Important notes: from now on, function prototypes should be written before the main function. And function definitions should be written after the main function. 10% will be deducted if this is not observed. Zybooks MODULES: MODULE 6 a.) (Lab4a.cpp) Chapter 6, “Falling Distance." The following formula can be used to determine the distance...

  • Java: Create a main method for your class, and then add another method to your class...

    Java: Create a main method for your class, and then add another method to your class (above the main method) named fallingDistance. This method accepts an integer into its parameter t, which is the amount of time, in seconds, that an object has been falling. This method returns the distance, in meters, that the object has fallen during the time interval. When an object s falling because of gravity, we use the following formula to determine the distance the object...

  • Intro To Java Class. AS SIMPLE AS POSSIBLE. Please post the pic of code, will up...

    Intro To Java Class. AS SIMPLE AS POSSIBLE. Please post the pic of code, will up Vote! You will need to use Blue) for the following questions. Although these are programming exercises, remember always that the first step to the program is to put your ideas on paper to organize your thoughts. Remember Section 1.6: The Programming Process. Centigrade to Fahrenheit Table Write a program that displays a table of the centigrade temperatures 0 through 20 and their Fahrenheit equivalents....

  • Write a program that displays a table of Celsius temperatures 0 through a number entered by...

    Write a program that displays a table of Celsius temperatures 0 through a number entered by the user and their Fahrenheit equivalents as in the figure below. The formula for converting a Celsius temperature to a Fahrenheit temperature is: F = 9 / 5 * C + 32 where F is the Fahrenheit temperature and C is the Celsius Temperature. Your program must use a 'for' loop. Display all temperatures to one decimal place. Write a program that displays a...

  • Write a C++ console application that displays a table of Celsius temperatures from 0 through 20...

    Write a C++ console application that displays a table of Celsius temperatures from 0 through 20 and their equivalent Fahrenheit temperature values. The formula for converting from Celsius to Fahrenheit is: [In C++ Please] F==C + 32 Where, C is the temperature value in Celsius, and F is the equivalent temperature in Fahrenheit. Your program must use a loop to display the temperature values.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT