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
What might be some examples of Digital Citizenship Behavior?
likoan [24]

Answer:

Being nice to others and being respectful. Acting appropriately and with respect for you and others.

Explanation:

☆Hope this helps!☆

6 0
3 years ago
200 points and brianlist if. done correctly... When working in Scratch, after clicking on the Choose Backdropicon and making you
9966 [12]

Answer:

huh

Explanation:what is the question

7 0
2 years ago
Create a bulleted list of four descriptive terms describing possible values a person may have. These may be your own values, or
Minchanka [31]
Create a bulleted list of four descriptive terms describing possible values a person may have.

* always be true to yourself
* honesty is the best policy
* making mistakes leads you to solutions
* it's ok to be wrong
7 0
3 years ago
Which of the follow represents a form of disruptive technology? Tend to open new markets and destroy old ones A new way of doing
RSB [31]

Answer: All of the above are included

Explanation: Disruptive technology is the created for the manipulation of the business operations and related components significantly.It works by changing the habits of the business system by its more superior standards and ways.

The opening of new market to eliminate the older market, invoking in the marketplace for cheap range of goods and making a new strategy that does not fulfill the demand of the customer are disruptive strategy as they change the regular way of business operation through their techniques.

4 0
3 years ago
17. What is something an employer might look for in person when hiring? (3
inessss [21]
D. all of the above
6 0
2 years ago
Read 2 more answers
Other questions:
  • Identify the function for the following computer part: Printer Question 23 options: Input
    6·1 answer
  • 5 things that i learned about internet safty
    8·2 answers
  • In your opinion, is it more beneficial to have many folders or is it better to “nest” subfolders? Explain your response.
    10·2 answers
  • Numeric data is stored in ___________ for direct processing.
    6·2 answers
  • How does a barcode work?
    11·1 answer
  • 4
    5·1 answer
  • 2. (8 points) When creating the Academic Database, there were several instances of data
    11·1 answer
  • mapa mental con la explicación de que medios de comunicación y redes sociales intervienen en la construcción de tu identidad​
    10·1 answer
  • A binary search algorithm ____________ an ordered list in<br> half to find an item.
    13·1 answer
  • _____ is a higher-level, object-oriented application interface used to access remote database servers
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!