Write class encapsulating the concept of weather forecast

Assignment Help JAVA Programming
Reference no: EM13712069

Program- Write a class encapsulating the concept of the weather forecast, assuming that it has the given attributes: the temperature and the sky conditions, which could be sunny, snowy, cloudy, or rainy.

Include a default constructor, an overloaded constructor, the accessors and mutators, and methods, toString() and equals().

Temperature, in Fahrenheit, should be between -50 and +150; the default value is 70, if needed. The default sky condition is sunny.

Add a method that converts Fahrenheit to Celsius. Celsius temperature = (Fahrenheit temperature - 32) * 5/9.

Also add a method that checks whether the weather attributes are consistent (there are two cases where they are not consistent:

when the temperature is below 32 and it is not snowy, and when the temperature is above 100 and it is not sunny). Write a client class to test all the methods in your class.

Reference no: EM13712069

Questions Cloud

Find how many strings in a have exactly three 5s : Let A be the set of all strings of decimal digits of length five. For example, 00312, 99999, and 19483 are strings in A.
Create a gui message panel that uses 4 different fonts : Create a GUI message panel that uses 4 different fonts, colors and styles ( bold ect ) with messages of your choice.
Print the initial array and the resulting array : Take an N x N matrix, and create a new, (N-1) x (N- 1), matrix with each element being the sum of four nearby elements. You need to figure out a way to break the matrix up into squares and iterate through the matrix, while staying within its bound..
Splay tree and show the resulting tree : Insert 5, 1, 3, 6, 2, 4 into an initially empty splay tree and show the resulting tree - Can you provide some help with my Java language project? I hope someone nice out there can help me with it.
Write class encapsulating the concept of weather forecast : Write a class encapsulating the concept of the weather forecast, assuming that it has the given attributes: the temperature and the sky conditions, which could be sunny, snowy, cloudy, or rainy.
Computes a students grade for an assignment : Write a C++ program that computes a student's grade for an assignment as a percentage given the student's score and total points.
Construct minimal avl trees of height : Construct minimal AVL trees of height 0, 1, 2, 3, and 4. you do not need to fill in the values, just draw the structure of the tree. Tip: Use the recursive definition for the number of nodes in a minimal AVL tree.
Design and implement an application to manage a tournament : Design and implement an application to manage a tennis tournament of 16 players - design and implement an application to manage a tournament. Is there anybody who knows how to do this?
Find ip address of your computer : Find IP Address of your computer(My IP Address: 192.168.1.5) - What is the length (#bytes) of the IP Address?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write an object-oriented java program to manipulate data

I want a simple java solution matching all the specifications in the document. The java program has to be made using Eclipseversion 4.2.1.

  Micks wicks makes candles in various sizes create a class

micks wicks makes candles in various sizes. create a class for the business named candle that contains data fields for

  The api for this class ispublic void poweronnbsp sets the

the api for this class ispublic void poweronnbsp sets the machine ready to serve the selected ice creampublic void

  Write a class to represent a credit card.

write a class to represent a credit card.

  Alicia creates a button using the code jbutton exit button

Alicia creates a button using the code JButton exitButton = new JButton("exit"); and places it into a JFrame named mainFrame

  What is relationship between hashing and digital signatures

The security advantages of using two-factor authentication, such as the integrated fingerprint reader in the more recent iPhone models, particularly to support internet services (such as online banking)

  Simulate a simple version of a game called liar dice

The first player claims a Poker hand (see "Hand Ranks" below for legal calls). When making a claim, a player says what all five dice are, not just the name of the hand. For example, a player should say, "I have a full house: three 4s and two 5s," ..

  Uses a 2-d array to store the highest and lowest temperature

Write a program that uses a 2-D array to store the highest and lowest temperatures for each montjh of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of ..

  Design and develop a console application

Required to design and develop a console (text-based) application for a small car servicing company -

  Write java program to evaluate postfix expressions

Write a java program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes.

  Redesign the grading program as an object-oriented design

Redesign the grading program as an object-oriented design. We will start with a simple Student class. The student will have a name, an id (as a String) and a set of grades (as doubles).

  Prepare a java program to create a gui

Prepare a java program to create a GUI and show the picture of the zodiac. Be sure to include comments. The comment should describe the purpose of the program and the data to be entered.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd