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

  Related to the polygon

Assume n=3 and P has positive area. Explain how to determine efficiently whether exactly one of the point’s q and r falls inside of P. Analyze how much time is utilized.

  Write down the syntax for a 2d array

Write the syntax for a 2D array which has four rows. The first row would have 10 elements and the second row will have 5 elements. The third row will have 8 elements and the fourth row will have 12 elements.

  Give the pseudocode for the flowchart

make a flowchart and give the pseudocode for searching an array for a specified value.

  What does the name ajax stand for

What does the name Ajax stand for? What is Ajax, and what does it do? Give an example of how Netflix® uses Ajax, and define why this makes the Web site faster.

  Illustrate precedence graph

Illustrate precedence graph

  How can be secure mail infrastructure using identities

How can be secure mail infrastructure using identities.What may be a new approach to secure mail infrastructure?

  How concepts using the osi model as a framework

Your manager has asked you to describe the frame format of a typical Ethernet packet. Prepare a written report. Be sure to discuss Manchester encoding, 4B/5B encoding, 8B/10B encoding, the cable grades required for different speeds of Ethernet, an..

  Address operating systems that .net does not support

Why will a company like Microsoft choose to create the .NET proprietary platform when J2EE is readily available? As a software developer, how could you address operating systems that .NET does not support.

  Developing the gui application

Write down a GUI application which prompts user for a number between 1 and 5. Be sure to involve error checking so that program continues to prompt the user for a number till the user's entry is between 1 and 5, inclusive.

  Designing the bits for four octets of ip addres

A firm allocated the network part 128.171. It chooses an 8-bit subnet part. a) Design the bits for four octets of IP address of first host over the first subnet.

  How to write a c function named change()

The function should find the number of quarters, dimes, nickels, and pennies in the number passed to it and write these values directly into respective variables declared in its calling function.

  Biometric user authentication

You have just been promoted to manager of computer security for a large enterprise (XYZ Corporation). Your first project as the security manager is to compute the principal of physical characteristics utilized for biometric user authentication.

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