Sirisha K

Sirisha K

  • NA
  • 454
  • 32.2k

java

Mar 3 2016 6:12 AM

Design and implement a class for Wind speed.

Wind speed often is measured in kilometer per hours (km/h) or knots (nautic miles). Another measure is the Beaufort scale consisting of integer numbers from 1 to 12.

Design and implement a Java class, for creating wind speeds. Implement a constructor to create wind speed for a given velocity in kilometers per hour. The class must contain methods for getting the speed as knots or on the Beaufort scale. Furthermore, it must be possible to check whether the wind is calm or a European windstorm (Orcan).

Wind speeds less than 2 km/h are calm. More than 120 km/h is a European windstorm. A nautic mile is 1,852 Kilometer. The Beaufort scale is defined by v = 3,01 * B3/2, with v as the wind velocity in km/h. The Beaufort value B is rounded to the nearest integer. There are no Beaufort values larger than 12.

Hint: You can calculate ab with Math.pow(a,b).

How to solve this question

Answers (3)