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 java program to display results in java applet

Write down the java program which displays following results in java applet. Permits the user to enter three numbers (use JOptionPane for this) and prints out average of those value on screen.

  Technical community blog

Write a blog article for a coding and technical community blog.

  Write a java program that creates 3 threads

Write a Java program that creates 3 threads each of them performing 10 reading/writing to the shared location. Use a random number generator to decide if the request is reading or writing

  Web engineering principles

web application development, Web Engineering methodology, UML-based Web Engineering (UWE), models to the expansion of web applications, Object Oriented Web Solutions (OOWS),Web Modeling Language (WebML) methodology, Object-Oriented Hypermedia Design..

  Write java program to find calories-conditional operator

Write down the answer for this program? Write down Java program (use Conditional (? Operator) which suggests number of calories a person must eat each day.

  Create a bar chart that illustrates sales.

Hal's Used Cars has four salespeople named Pam, Leo, Kim, and Bob. Accept values for the number of cars sold by each salesperson in a month, and create a bar chart that illustrates sales. Save the file as BarGraph.java.

  Calculates the cutoff frequency in a simple rc circuit

Write a simple Java application which calculates the cutoff frequency in a simple RC circuit

  Write a simple java program that will read an array of info

write a simple java program that will read an array of information containing the information (Name, offence [between arson, assault or theft] and year of offence

  A class for counting the number of people

Specification: A class for counting the number of people in a room. This might be used to control how many people are allowed into a club with a doorman.

  Create a japplet

Create a JApplet that contains a JLabel and JButton. You'll create a JButton that will automatically change font typeface, style, and size when clicked by the user.

  Savingsaccount and bankaccount objects

The only differences between SavingsAccount and BankAccount objects is that SavingsAccount have an interest rate and can compute interest when necessary. Add an instance variable and a method to SavingsAccount to allow for these items.

  Punished for minor infractions given their mental illness

What if you a Disciplinary Hearing Officer in a unit with mentally ill inmates? How would you sanction offenders for infractions without punishing them for their illnesses? Do you think they should be punished for minor infractions given their mental..

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