How will you access the size attribute of building

Assignment Help Computer Engineering
Reference no: EM1337456

Described below are three classes, Building, Hotel and Home with their respective attributes:
Building: no_of_floors, age , parking_space, size
Hotel: number_of_guests, number_of_rooms, vacancy, no_of_floors, age, parking_space, size
Home: No_of_bedrooms, no_of_occupants, finished_basement, no_of_floors, parking_space, age, size

Questions 1 through 5 are based on the classes described above:

1. Write a declaration for all three classes using the principles of inheritence. Make the Building class abstract
2. Which of the following statements is incorrect:
a. Hotel h = new Hotel();
b. Home m = new Home();
c. Building b = new Building();

3. Do Hotel and Building have an "Is A" relationship or "Has A" relationship?

4. Which of the following is true:
a. Hotel and Home are subclasses of Building
b. Hotel is a subclass of Building, Home is a subclass of Hotel.
c. Home, Hotel and Building are independent classes
d. Hotel and Home are containment classes of Building

5. If Hotel were a subclass of Building, how would you access the size attribute of Building:
a. Hotel h = new Hotel();
h.new Building();
h.size = 5;

b. Hotel h = new Hotel();
h.Building.size = 5;

c. Hotel h = new Hotel();
h.size=5;

Reference no: EM1337456

Questions Cloud

The sales strategy of coca-cola : Determien the sales strategy of Coca-Cola.
Illustrate what is the difference between a movement : Illustrate what is the difference between a movement along and shift of the demand curve and supply curve. How does a surplus or a shortage of a good or service affect the market price.
Stock valuation in efficient market for natsam corporations : Natsam Corporation has $250 million of excess cash. The firm has no debt and 500 million shares outstanding with a current market price of $15 per share. What is the ex-dividend price of a share in a perfect capital market?
Explain marketing mix of alcohol monitoring system : Explain Marketing mix of Alcohol monitoring system and Describe the message I wish to communicate based on the core strategy and explain my rationale for the message
How will you access the size attribute of building : Write down a declaration for all three classes using the principles of inheritence. Make the Building class abstract.
Depends on the ideas two economists : Depends on the ideas, explain with which of the two economists do you agree more and explain why.
Determine the consequences of the risks : Determine the consequences of the risks are the potential consequences worth the risks?
Express currently used tools and recommended measures : Web phishing, pharming and vishing are popular web based scams. examine currently used tools and recommended measures to defeat this kind of attacks efficiently? Specifically focus on solutions that can be implemented at the network infrastructure ..
Finding critical path and project duration : Find the critical path and project duration in days. Given that each resource is assigned 100% to each task, identify the resource constraints.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down an mdi application, using visual basic.net

You have been commissioned to write an MDI application, using Visual Basic.NET, for the new Clothing Store.

  Facilitate requirement elicitation, specification

What process or tools are you familiar with that facilitate requirements elicitation, specification and decomposition?

  What do you mean by ado.net

Your boss met with you this morning to inform you that the system you wrote two years ago using dBase IV now needs to be rewritten using Visual Basic.NET and ADO.NET.

  Make program that has a declaration in main () to store

require a C program that has a declaration in main () to store the following numbers into an array named rates:2.3,3.3,4.4,5.5,6.0. There should be a function call to show () that accepts rates in a parameter named rates and then displays the numb..

  The web to find examples of the following site structures

Browse Web to find examples of the following site structures (A. Linear and B. Hierarchical) and describe how the content fits the structure.

  Find the worst-case runtime of this incorrect algorithm

What is the worst-case runtime of this incorrect algorithm? supply as tight an asymptotic upper bound as possible, using Big-Oh notation as a function of n. Justify your answer.

  What is an approximate total channel load

Ten thousand airline reservation stations are competing for the use of the single slotted ALOHA channel. The average station makes 18 requests per hour. A slot is 125 micro-seconds.

  Addressing and naming model

Sketch a plan for development of the addressing and the naming model in an environment of following given scenario: Ten (10) departments in the 1,000-employee organization. Equal separation by geography

  It techniques used for security at airport

Browse the Internet for obtaining the Information about the airport security regarding bomb and weapon detection devices.

  Altering the dijkstra’s algorithm

Alter Dijkstra’s algorithm in order to compute the shortest paths from the source vertex s in O(W·|V|+|E|) time.

  A function to see if one list is a shallow copy of other

A function to see if one list is a shallow copy of other

  Expand or contract the number of phases

What is the Software/System Development Life Cycle (SDLC) and can we expand or contract the number of phases depending on the particular project?

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