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
In asps, the code to tie the database to the web site is typically written in javascript or ____.
Dominik [7]
In asps, the code to tie the database to the web site is typically written in javascript or VBScript<span>(Visual Basic Script).
</span>VBScript is an interpreted script language from Microsoft<span> with syntax very similar to that of Visual Basic.
</span><span>Most often VBScript is used for Quick Test Professional (QTP), which is a test automation tool.</span>
4 0
3 years ago
Which risk mitigation framework allows scope for research and acknowledgement for risk mitigation?
hjlf
The answer is that by establishing the framework<span> for the management of risks, the basic parameters within which risks must be managed are defined. Consequently, the </span>scope<span> for the rest of the </span>Risk Management<span> process is also set. </span>
6 0
3 years ago
Read 2 more answers
Which type of computer are todays most widely used personal computers?
iris [78.8K]

Answer:

Windows 10. :)

Explanation:

8 0
3 years ago
Read 2 more answers
To add an animation to a slide in PowerPoint Online, what is the first step you need to complete?
velikii [3]

To add an animation to a slide in PowerPoint Online, what is the first step you need to complete is to Select the Text object.

<h3>How do you  add animations to text?</h3>

The steps are:

  • Select the object or text that is to be animated.

  • Select Animations and then choose the one that you want.

  • Select Effect Options and then choose the one you want.

Note that To add an animation to a slide in PowerPoint Online, what is the first step you need to complete is to Select the Text object as one needs to choose a slide, select an object before one can add animation.

Learn more about animation from

brainly.com/question/18260878

#SPJ1

6 0
1 year ago
I. Name and describe two options in Orientation.
goldfiish [28.3K]

Answer:

Page orientation is the direction in which a document is displayed or printed. The two basic types of page orientation are portrait (vertical) and landscape (horizontal). Most monitors have a landscape display, while most documents are printed in portrait mode.

Explanation:

3 0
3 years ago
Other questions:
  • Exit network systems, information support, and software development are all careers in which career cluster?
    10·1 answer
  • Electronic ledger that tracks mathematical data
    15·1 answer
  • A(n) _____ is a simple database program whose records have no relationship to one another.
    10·1 answer
  • Southern States<br> Wanted...<br> But...<br> So...
    12·1 answer
  • Write a method called printRange that accepts two integers as arguments and prints the sequence of numbers between the two argum
    6·1 answer
  • An alien from planet Tao has descended onto Earth.
    12·1 answer
  • If the user loads this graphic in a text only browser how will the browser describe it?
    11·2 answers
  • What is a technological advancement that is now being used in tractors throughout America?
    6·2 answers
  • Wyjaśnij w jaki sposób wykonuje się nitowanie zakładkowe i nakładkowe, oraz wyjaśnij na czym polega pasowanie mieszane.
    7·1 answer
  • Elan inserted shapes into a slide in his presentation. What is the quickest way to format those shapes?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!