1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
a_sh-v [17]
3 years ago
15

Hit and Slopes Program: A Write a program that can be used by a ski resort to keep track if local snow conditions for one week.

It should have two seven-element arrays to store the date and number of inches of snow (consider the parallel array concept discussed in the class). First, the program should ask the user to enter the name of the month. Then, it should have the user enter dates and corresponding snow fall. Once data is entered, store them in two arrays mentioned above. Then, the program should produce a report for the week with following information. a) Highest snow fall. b) Average snow fall.
Computers and Technology
1 answer:
Llana [10]3 years ago
5 0

Answer:

The java program is as follows.  

import java.lang.*;  

import java.util.Scanner;  

public class Main  

{  

//array declaration  

static int weekdays=7;  

static int[] snowfall_inch = new int[weekdays];  

static String[] snowfall_date = new String[weekdays];  

//variables to store average and maximum  

static double avg;  

static int max;  

public static void main(String[] args) {  

Scanner sc = new Scanner(System.in);  

System.out.print("Enter the month: ");  

String month = sc.next();  

for(int n=0; n<weekdays; n++)  

{  

System.out.print("\nEnter the date for day "+(n+1)+ ": ");  

snowfall_date[n] = sc.next();  

System.out.print("Enter the inches of snowfall for day "+(n+1) +": ");  

snowfall_inch[n] = sc.nextInt();  

avg = avg + snowfall_inch[n];  

}  

avg = avg/weekdays;  

System.out.printf("The average snowfall for the week is %.4f",avg);  

for(int n=0; n<weekdays-1; n++)  

{  

if(snowfall_inch[n] < snowfall_inch[n+1])  

max=snowfall_inch[n+1];  

}  

System.out.println("\nThe maximum snowfall for the week is "+max);  

}  

}  

OUTPUT  

Enter the date for day 2: 12-2-2019

Enter the inches of snowfall for day 2: 23  

Enter the date for day 3: 12-3-2019

Enter the inches of snowfall for day 3: 13  

Enter the date for day 4: 12-4-2019

Enter the inches of snowfall for day 4: 14  

Enter the date for day 5: 12-5-2019

Enter the inches of snowfall for day 5: 34  

Enter the date for day 6: 12-6-2019

Enter the inches of snowfall for day 6: 34  

Enter the date for day 7: 12-7-2019

Enter the inches of snowfall for day 7: 22

The average snowfall for the week is 21.7143  

The maximum snowfall for the week is 34  

Explanation:

1. Two arrays are declared to store dates and snowfall inches with string and integer datatypes respectively.  

2. Variables are declared to store maximum and average snowfall values with integer and double datatypes respectively.  

3. User input is taken for the month, and the dates and snowfall inch values for a week. The input is taken in for loop.  

4. Next, for loop is used to find the average and maximum snowfall of the week.  

5. These values are displayed to the user as shown in the output.

You might be interested in
Overlay analysis is ____________, taking in data from two or more layers to create a single output layer.
Wewaii [24]

Explanation:

Overlay analysis is an approach, taking in data from two or more layers to create a single output layer.

For example, if we have a layer of land use and a layer of soil fertility, we can derive from the two layers the percentage of agricultural land developed over fertile soil.

6 0
3 years ago
.in the array based list implementation of the ADT what is the worst case time efficiency of the getEntry method?
kenny6666 [7]

Answer:

c.O(n)

Explanation:

In the array based list implementation of the ADT the worst case time complexity of the getEntry method is O(n).In the worst case it has to travel upto n elements then it has to do the operation.In doing so  the time complexity will come out to be O(n).So we conclude that the answer to this question is O(n).

5 0
3 years ago
Where in an email would u find information about the action requirements​
Assoli18 [71]

Answer:When trying to find the action that you need to do in an e-mail, it is best to consult the body of the email, also known as (B) in the message.. The message would detail the tasks that you need to tackle, which are generally not detailed in the subject line, greeting, and you will most definitely not find in the to field.

Explanation:

3 0
3 years ago
10 points + brainliest to first correect answer :) incorrect answers/ answers with no effort will be deleted this is easy im jus
Gala2k [10]

Answer:

The first option is incorrect

Explanation:

With the Control+C method, you copy the text. With the Control+V method, you paste it. You do not remove any of the text and instead create a duplicate

6 0
2 years ago
A hub is a central computer true or false?
klio [65]

Answer:

hub is central computer.....True...

4 0
2 years ago
Read 2 more answers
Other questions:
  • What is the purpose of this diamond shape in a flowchart?
    8·1 answer
  • Which magazine can help the public to determine the best technology to buy?
    14·1 answer
  • What is the full form of icimod?
    6·1 answer
  • Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per li
    11·1 answer
  • C++
    11·2 answers
  • All of the following are valid Excel arithmetic operators except _____.
    11·1 answer
  • VOTE!
    11·1 answer
  • Misspelet errors are displays with a ...<br>.. below them<br>​
    10·1 answer
  • Help!!
    15·1 answer
  • Sigma Technology is a company based in Singapore, with branches in 24 countries. It needs multiple CAs in different locations to
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!