Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

finish the WeatherDatabase plz! thanks public class BuildDatabaset /** Build a small database of weather stations *@param args is not used in this program public

finish the WeatherDatabase plz! thanks

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

public class BuildDatabaset /** Build a small database of weather stations *@param args is not used in this program public static void main (String[] args)t // sample database WeatherDatabase db -new WeatherDatabase) some WeatherStations WeatherStation[] stations -new WeatherStation [3]; stations [0]new WeatherStation ("YOW-Airport", 1); stations [1 new WeatherStation ("Downtown", 2); stations [2] new Weatherstation ("Fallowfield-Railway-station", 3); int[l days -1,2,2,2,4,7,11,20,30,32); double [ ] temps {10.0, 11, 12, 10, 9.2, 28.1, 10.5, 20, 23, 24): // populate Yow with some weather reports System.out.println("Building YOW WeatherStation"); for (int i-0; iths.numberofweatherstations ( ). public Weatherstation[] getweatherstations return null; /t* Returns the number of weather stations in the database * @return the number of weather stations in this database public int numberofweatherStations) return-1:) /**adds a weather station to this database *@param station is the weather station to add. It will always be non-null. return this weather station. public WeatherDatabase addWeatherstation (WeatherStation station) return this // do NOT change the return statement /**removes weather station with given id from this database *@param id is the ID number of the weather station to remove. *@return true if the specified weather station is successfully removed, returns falsetherwise (i.e., if there was no weather stati n with the specified ID number in this database to begin with) . public boolean removeWeatherStation (int id) ( return true; /**returns the highest temperature ever recorded by any weather station * in the data base public Temperature getMaxTemperature ) return null;) /**returns the highest temperature on a specified day * that is recorded in a report in the weather stations in this database. *@param day is the day to find the max temperature on. Note that this might be the special max temperature day that a weather station records. *@return the temperature object with the highest recorded Temperature in the data base on the specified day public Temperature getMaxTemperature (int day) ( return null;) /**Computes the average temperature (over all weather stations) for the *time period starting at startDay and ending at endDay (inclusive) *@param startDay is the starting day @param endDay is the ending endDay *@return the average temperature of all temperature reports for the time period startDay to endDay (inclusive) taken from all weather stations in this weather database. public double averageTemperature (int startDay, int endDay) l

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

2. Identify conflict triggers in yourself and others

Answered: 1 week ago