Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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;

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9212824

Have any Question?


Related Questions in Computer Engineering

We live in kapurkua a small island in the mediterranean

We live in Kapurkua, a small island in the mediterranean between Greece and Spain (no, it doesn't really exist so don't look it up in the map). In the island we produce and consume canoes, latreks (a garment that is comf ...

Fully explain at least one reason why many developing

Fully explain at least one reason why many developing countries suffered serious debt crisis in the early 1980s. Does this reason you explained in debt support Krueger & Srinivasan's argument? Why or why not? How could t ...

Assignment -question 1 - go-back-n in the following network

Assignment - Question 1 - (Go-Back-N) In the following network, node A transmits packets that pass through B and C, and arrive at the destination D. The bit rate of all links is R = 1 Mbit/sec. The maximum packet size in ...

Question a with respect to huffman coding devise a formula

Question : (a) With respect to Huffman Coding, devise a formula to compute the average compression based on the number of characters in a piece of text, n, and the number of unique characters in its alphabet, m. (b) Does ...

Suppose two nodes a and b are attached to opposite ends of

Suppose two nodes, A and B, are attached to opposite ends of an 800 m cable, and that they each have one frame of 1, 500 bits (including all headers and preambles) to send to each other. Both nodes attempt to transmit at ...

Referring to myerss article there is a quote from stu card

Referring to Myers's article, there is a quote from Stu Card on page 52.This represents 1998's reality and vision for HCI research. Do you think that this vision explains innovation and research in HCI 1998-2017? Researc ...

We might consider a regression of the number of group

We might consider a regression of the number of group members and the efficiency of project completion. Which of those would be the dependent and which would be the independent variables?

A single precision ieee 754 number is stored in memory at

A single precision IEEE 754 number is stored in memory at address X. Write a sequence of ARM instructions to multiply the number at X by 16 and store the result back at X. You must accomplish this without using any float ...

This is a scilab question only and must be answered in

This is a SCILAB QUESTION ONLY AND MUST BE ANSWERED IN SCILAB LANGUAGE PLEASE or else I will not be able to understand, Please show every step, many thanks in advance!!! Consider the polynomial: Find the value q(x = 6), ...

Discuss honeypots are they legal should they be legal what

Discuss honeypots. Are they legal? Should they be legal? What are some of the potential problems for those implementing a honeypot?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As