Question 1a write class weather to contain the following-i

Assignment Help Software Engineering
Reference no: EM13348810

QUESTION 1

(a) Write class 'Weather' to contain the following:-

(i) Data members- humidity, air_pressure, atmospheric_temperature and wind_speed all of datatype double
(ii) A no-argument constructor to initialize humidity to zero
(iii) An overloaded constructor with 1 parameter to assign a value to the air_pressure
(iv) An overloaded constructor with 2 parameters to assign values to the humidity and air_pressure
(v) An overloaded constructor with 3 parameters to assign values to the humidity, air_pressure, atmospheric_temperature
(vi) An overloaded constructor with 4 parameters to assign values to each of the variables declared
(vii) Set method for each of data members
(viii) Get method for each of the variables

(b) Write down an application to perform the following-

(i) Create a 'Weather' object using the no-argument constructor
(ii) Create a second 'Weather' object using the overloaded constructor one parameter
(iii) Create a third 'Weather' object using the overloaded constructor two parameters
(iv) Create a fourth 'Weather' object using the overloaded constructor three parameters
(v) Create a fifth 'Weather' object using the overloaded constructor four parameters
(vi) Use the set methods to assign values to each of the variables declared
(Vii) Display the values using message dialog


QUESTION 2

(a) Write the interface 'WaterResource' to surround following-

(i) Method 'water_amount' of datatype double
(ii) Method 'resource_name' of datatype String

(b) Write down class 'Reservoir' which implements the interface 'WaterResource' and contains the following:-

(i) String variables: name and location
(ii) Variables- capacity and amount_available of datatype double
(iii) Set method for each of the variables
(iv) Get method for each of the variables
(v) Override 2 methods inherited from the interface WaterResource

(c) Write the class 'Lake' that inherits from the class 'Reservoir' and contains following-

(i) A variable area_size of datatype double
(ii) A set method to assign value to the area_size
(iii) A get method to return the value of area_size
(iv) Override method water_amount inherited from super class Reservoir to indicate the amount of water available in the lake
(v) Override the method resource_name inherited from super class Reservoir to return the name of the resource that is lake.


QUESTION 3

Clarify following OO concepts using appropriate java code extracts-
(a) Encapsulation
(b) Inner class
(c) Polymorphism
(d) Constructor chaining
(e) subclassing

 

Reference no: EM13348810

Questions Cloud

Question 1 preparation is considered to be a key process in : question 1 preparation is considered to be a key process in project management. examine the key areas which form part
Question 1project management is considered to be a process : question 1project management is considered to be a process and there are four key elements of process namely-1.
Question 1in view of growing number of deaths on the road : question 1in view of growing number of deaths on the road the police department plans to introduce more speeding
Question 1 a inscribe detailed notes related to : question 1 a inscribe detailed notes related to object-oriented concepts on the following-i class and object
Question 1a write class weather to contain the following-i : question 1a write class weather to contain the following-i data members- humidity airpressure atmospherictemperature
Question 11a write the class ingredient to contain the : question 11.a write the class ingredient to contain the following-i integer variable ingredientid ii string variables
Question 1read the excerpt attached carefully and answer : question 1read the excerpt attached carefully and answer the following questions-ai two roles of hrm namely i boosting
Question 11a you are about to undertake the development of : question 11a you are about to undertake the development of a system for a small businesswhich system development life
Question selected accounts of the weinstein musical society : question selected accounts of the weinstein musical society a nongovernment not-for-profit organization for the year

Reviews

Write a Review

Software Engineering Questions & Answers

  Web authoring application

Compare the drawbacks and benefits of using a Web authoring application, an HTML editor and a text editor for developing websites.

  Beats number at output of first round of des decryption

Calculate the beats number 1, 16, 33, and 48 at output of first round of DES decryption, suppose that ciphertext block is composed of all ones.

  Develop a functional web-based application for a calculator

Develop a functional web-based application for a calculator. It does not need to be live; you can provide JavaScript, CSS, and HTML files. The calculator should successfully complete addition, subtraction, multiplication, and division operations..

  Compute the crc code word for the information word

Using CRC polynomial 1101 compute the CRC code word for the information word 01001101. Check the Division performed at the receiver.

  Create a diagram for many-to-many relationship of entity

One-to-many or many-to-many relationship. Then, using short-hand notation introduced in text, create a diagram for each of the relationships.

  Calculating a discount that customers receive

Computing a discount that consumers receive based on the value of their order. If the total value ordered is less than $20, no discount will be given.

  Design of the software

Report of the software design and implement the software as per the design, and demonstrate it

  Draw the physical data flow diagrams

Draw the physical data flow diagrams. Use Microsoft Visio to prepare examples of flow charts and data flow diagrams.

  Sketch flowchart to print average for student

Sketch a flowchart to print average for each student in class.Input. Input consists of student records each containing student's name(STUDENT-NAME), score for first test(TEST), score for second test(TEST2), and score for third test(TEST3).

  Specify the entity-relationship diagram for database

Specify the entity-relationship diagram for this database. Do not forget to underline main attributes and include arrowheads indicating multiplicity of relationships.

  Part 1 theory and business1identify computing devices which

part 1 theory and business1.identify computing devices which could be used to support your improved process.2.identify

  Create inheritance hierarchy for customer-s bank account

Create inheritance hierarchy which a bank might use to represent customer's bank accounts. All customers at this bank can deposit money into their accounts and withdraw money from accounts.

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