Matjaz

Matjaz

  • NA
  • 13
  • 3.2k

problems with my homework

Apr 12 2011 6:23 AM
Hello!

I am having problem with my homework on methods and classes. I have started doing the first one, but I am pretty much lost.
Here are the two tasks I have for my homework:

1.) The weather man Coldy would like to manage information on his measurements. For every measurement he keeps information on time of measurement, location of a measurement and altitude. The measurement represents current temperature, humidity and barometric pressure. Besides that, he keeps writing his notes.

Write a class 'Measurement' to process information on measurements, that have been done. The program should contain two constructors. The first one should contain all parameters of the measurements, the second one should take the system time as the time of measurements, the remaining parameters should be defined by a user of a class.

Write the method, which allows the user to gain an access to all input or entered information (you can do it with get property). Write the methods, which allow a user to make notes on the measurements (you can do it with set property).

Write a method, which writes basic information on the measurement in a user-friendly way (you can change the standard method ToString).

2.) Write the main program, which will help Coldy to analyze the information on the measurements. For starters, the program should randomly 'generate' measurements according to the next algorhytm:

-for every city listed: Ljubljana(295-altitude), Kranj(386-altitude), Maribor(275-altitude), Koper(4-altitude), Celje(238-altitude)
-starts with today at 6:00 and continues with a period of 8 hours
-randomly chooses temperature between -20 and +40 degrees Celsius
-randomly chooses humidity between 20 and 100
-randomly chooses barometric pressure between 990 and 1030

Let the generated information write into a file. Let it write on the screen the name of the city, where it has rained most frequently (humidity>95), the city with a maximum and minimum average temperature and an average barometric pressure in all measurements.

Can you help me out? I am really lost in the first one and the second one is a big unknown to me.
Thank you for your answers!
Matjaz

Answers (16)