Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, I need to modify the code shown so that it can perform what is requested in number 7. Please use java and use simple
Hi, I need to modify the code shown so that it can perform what is requested in number 7. Please use java and use simple operations.
Try This 21 Compute the distance to a lightning strike whose sound takes 7.2 seconds to reach you. * olass Sound \{ public static void main (String[] args) \{ double distance; distance =7.21100 System.out.println("The lightning is approximately " + distance + " feet away."); 6. Compile and run the program. The following result is displayed: |The lighting is approximately 7920.0 feet away. 7. Extra challenge: You can compute the distance to a large object, such as a rock wall, by timing the echo. For example, if you clap your hands and time how long it takes for you to hear the echo, then you know the total roundtrip time. Dividing this value by 2 yields the time it takes the sound to go one way. You can then use this value to compute the distance to the object. Modify the preceding program so that it computes the distance, assuming that the time interval is that of an echo Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started