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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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