Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1. Write a class for representing weather with the following attributes and methods Attributes int tempF /Temp in F int windSpeed I/wind speed in

image text in transcribed
Part 1. Write a class for representing weather with the following attributes and methods Attributes int tempF /Temp in "F int windSpeed I/wind speed in mph; int windChill; A value which shows the cooling effect of the wind in combination with low temperatures, in North America it is calculated based on the following formula: 35.74+0.62157-35.75V60.4275V06 Wind chill index F V- Wind velocity, mph T-Air temperature,T bool severe .If Wind Chill is less than-15 "F, it is considered as sever .Note: you need to decide carefully what is private and what is public and design constructors, set/get methods as needed Methods A no arguments constructor which initializes everything to some default values, windChill should be calculated based on the above A two argument constructor which takes two arbitrary alues and assigns them to tempF should be calculated based on the above formulae and windSpeed, windChill and e Set and Get methods for the first two attributes; using set and get methods enables you to keep the object in a valid state, like . Temperature should be between-50 and 150 Wind speed should be greater than 0 .Changing tempF or windSpeed should update windChill and sever double getWindChill) /Returns the value of windchill; boolean isSevere): I/ returns the severity String toString) // returns a meaningful string representing the object, for example: Current Temperature is 13 'F. Feels Like-3.6 F and Wind Speed is 17 mph

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_2

Step: 3

blur-text-image_3

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

Write down the circumstances in which you led.

Answered: 1 week ago