Using the Design Recipe and NetBeans, construct an algorithm, and then write a Java program based on the algorithm, to solve each of the following problems:
• (Engineering: acceleration) Average acceleration is defined as the change of velocity divided by the time taken to make the change, as shown in the following formula:
Write a program that prompts the user to enter the starting velocity v0 in meters/second, the ending velocity v1 in meters/second, and the time span t in seconds, and displays the average acceleration.
Sample Run (user input in color):
run:
Enter the starting velocity in meters/second: 5.5
Enter the ending velocity in meters/second: 50.9
Enter the time span in seconds: 4.5
The average acceleration is 10.1
BUILD SUCCESSFUL (total time: 10 seconds)
Science: calculating energy) Write a program that calculates the energy needed to heat water from an initial temperature to a final temperature. Your program should prompt the user to enter the amount of water (M) in kilograms and the initial and final temperatures of the water. The formula to compute the energy is
where M is the weight of water in kilograms, temperatures are in degrees Celsius, and energy Q is measured in joules. Make sure your program declares and uses a named constant for the term 4184.
Sample Run (user input in color):
run:
Enter the amount of water in kilograms: 55.5
Enter the initial water temperature: 3.5
Enter the final water temperature: 10.5
The energy needed is 1625484.0
BUILD SUCCESSFUL (total time: 10 seconds)
(Engineering: finding runway length) Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula:
Write a program that prompts the user to enter v in meters/second (m/s) and the acceleration a in meters/second squared (m/s2), and displays the minimum runway length.
Sample Run (user input in color):
run:
Enter speed in meters/second: 60
Enter acceleration in meters/second squared: 3.5
The minimum runway length for this airplane is 514.3
BUILD SUCCESSFUL (total time: 10 seconds)
(Science: wind-chill temperature) How cold is it outside? The temperature alone is not enough to provide the answer. Other factors including wind speed, relative humidity, and sunshine play important roles in determining coldness outside. In 2001, the National Weather Service (NWS) implemented the new wind-chill temperature to measure the coldness using temperature and wind speed. The formula is
where ta is the outside temperature measured in degrees Fahrenheit and v is the speed measured in miles per hour. twc is the wind-chill temperature. The formula cannot be used for wind speeds below 2 mph or temperatures below -58 °F or above 41 °F.
Write a program that prompts the user to enter a temperature between -58 °F and 41 °F and a wind speed greater than or equal to 2 and displays the wind-chill temperature.
Use Math.pow(a, b) to compute v0.16.
Make sure your program declares and uses named constants for:
• the term 35.74
• the factors 0.6215, 35.75, 0.4275
• the exponent 0.16
Sample Run (user input in color):
run:
Enter the temperature in Fahrenheit between -58F and 41F: 5.3
Enter the wind speed (>=2) in miles per hour: 6
The wind chill index is -5.6
BUILD SUCCESSFUL (total time: 10 seconds)
Need help with this Essay/Dissertation?
Get in touch Essay & Dissertation Writing services

