subject

20.5 ASSIGN LAB 5 "An array of temperatures"
Due: Tues, May 19, midnight. If you submit late or resubmit, you will receive 1 point for each week after the due date above.

Write a Java program that creates an array to store the 7 daily high temperatures - in Fahrenheit - that occurred in San Francisco during the first week of April. Your program will then convert these temperatures to Celsius and print their average in Celsius.

Use the following Fahrenheit temperatures for your user input. Note that your program will use the Scanner to read in the temperatures only, your program will not read in the dates; the dates are there just for your understanding:

1 April : 67.3

2 April : 63.2

3 April : 65.0

4 April : 63.1

5 April : 63.9

6 April : 64.6

7 April : 64.5

Once the Fahrenheit values are all stored in the array, convert them all to Celsius. Use the following formula:

Celsius = (Fahrenheit -32) * (5/9)

Only after the array contains all Celsius temperatures, calculate and print the average Celsius temperature for that week in San Francisco. Use a DecimalFormat object in order to format your output to have just one digit to the right of the decimal point. Define the length of the array as a final int so that it will be easy to change if you need to modify your program later to handle two weeks of temperatures.

Note that your program only prints a single number as its output. That number is the average Celsius temperature for the first week in April. As usual, you will not be able to start writing the Java code until you are able to perform these calculations yourself - without a computer - with pencil, paper and calculator.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
In the film "epic 2015," epic is the name for:
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
question
Computers and Technology, 22.06.2019 11:10
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Under which key category do the page up and page down keys fall? page up and page down keys fall under the keys category.
Answers: 1
You know the right answer?
20.5 ASSIGN LAB 5 "An array of temperatures"
Due: Tues, May 19, midnight. If you submit late o...
Questions
Questions on the website: 13722361