👤

Declare an array of double of size 365 to store daily temperatures for one year. Using this data structure, write a code fragment to find -The hottest and coldest days of the year. - The average temperature of each month. - The difference between the hottest and coldest days of every month. - The temperature of any given day. The day is specified by two input values: month(1,…,12) and day (1,…,31) . Reject invalid input values (e.g., 13 for month and 32 for day). Part 2 Repeat part 1 , using a two-dimensional array of double with 12 rows and each row having 28,30 , or 31 columns.

Answer :

You can use an array to do the task :

double[] temperatures = new double[365];

What is an array?

An array is a data structure that is used to store a collection of items. It is typically used to store items of the same type, such as a list of integers or a list of strings.

Each item in an array is called an element, and each element has a specific index, or position, in the array. Arrays are commonly used in programming because they allow for efficient access and manipulation of large amounts of data.

To Know More About Datatypes, Check Out

https://brainly.com/question/28706924

#SPJ1