Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The USDA maintains a slew of sensors in the backcountry that track snow fall totals You are going to build a class to represent a

image text in transcribed

The USDA maintains a slew of sensors in the backcountry that track snow fall totals You are going to build a class to represent a Snotel site and a Driver to manipulate it (add snow, print stuff) A Snotel site will consist of a name (such as "Shower Falls"), an elevation (such as S100). current snow depth (such as 13.4). and snow water equivalent, swe, (such as 2.7) - this is the depth of water on the ground if we melted all the snow at the site. We will assume that snow does not melt. After signing into one of the lab computers, open up the Blue J environment and create a new project called Inlab2 Within the Inlab2 project, create a new class called Snotel Site Create instance variables m the Snotel Site class to fit the specifications detailed m the Problem Statement. (You can name the variables however you see fit) Make a constructor that takes the name of the site and elevation, but not the snow depth or swe, and sets the correct variables. Make a "get method" for each instance variable. Make a printlnfo method that will print the name, elevation, current snow on the ground, and swe, Make it read well, like tins: Shower Falls. S100: 10.5 inches for 2.1 niches of water. Make a method that will add snow to the snow depth and update the The input parameter will represent the amount of new snow that has fallen. The snow depth will be updated (just add the new snow to it). The will also be updated by adding 20% of the new snow amount (e.g. if the is 5. and 10 niches of snow falls, the will now be 7). In the hilab2 project, create a class called Driver with a main method like we did in class. Maui method header: public static void main(Stmig[] args) Within the main method, create a variable that can hold an instance of die SnotelSite class. Create an instance of the SnotelSite class where the name is "Shower Falls" and elevation is 8100 and store this instance in die variable you created Create a second instance of SnotelSite with parameters of your choosing and store in another variable. Simulate a storm by calluig the method you made to modify the snow depth on each SnotelSite instance. Call printlnfo on each instance to see die results (check to make sure it did what it should). Simulate another storm and also prmt diose results (i.e. you should be simulating two storms and printing data two times for each instance ui the Driver). Test all this by running the main method m Driver (right click Driver, select void mani(Strmg[] args). select "ok") and check that the output is correct

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions