Generate a unique identification number for each object

Assignment Help Basic Computer Science
Reference no: EM131193529

1. Keeping in mind all object-oriented programming best practices, create a class for a Chair, with the following specifications:

-. Specify two data members

-. Default Constructor

-. Overloaded Constructor which takes both data member values as input.

-. Generate a unique identification number for each object instantiated from this class. Use a static data member to keep track of the identification number last assigned to an object so that duplications will not occur. 

-. Show a statement which instantiates an object of this class using the overloaded constructor.

You do not need to provide any accessor/mutator methods or other methods.

2. Given the following list of classes, attributes and methods, 

- identify which items are classes, which items are attributes and which items are methods;

- identify which class each attribute and method belongs to; and

- suggest a class hierarchy given your list of classes.

*Note - no particular capitalization scheme is used in the list below to differentiate between classes, methods, and attributes.

AdhereToBuilding, NumberOfPetals, Photosynthesize, EmitFragrance, Length, Plant, Height, DaysToGermination, Rose, Grow, LosePetals, ConsumeWater, FloweringSeason, Vine, Color, LeavesPerInch

3. Briefly describe what an interface is and how it can be used in an object-oriented program. Provide example pseudocode showing how an s Interface might be constructed. 

4. How do you make an abstract method? When a class contains abstract method, what will happen? Can we still treat the class like a normal class? Provide pseudocode that represents an abstract class with at least one abstract method.

5. Define and implement the overloaded constructors that support the following test function for a Rectangle class. The data members for the Rectangle class are length and width. Both are integer data types.

public static void main(String args[])

//r1 will take all default value
Rectangle r1 = Rectangle(); 

//r2 will take all supplied value
Rectangle r2 = Rectangle(4, 5); 

//r3 will take supplied length. width will take default value
Rectangle r3 = Rectangle(10); 

//r4 will take the same value of r2
Rectangle r4= r2; 

//the rest of the code

Verified Expert

An interface in java is a blueprint of a class. It contains static constants attributes and abstract methods only. In java it is the way to achieved fully abstraction.

Reference no: EM131193529

Questions Cloud

Ddl and dcl to manage databases : Define DML, DDL, and DCL, and discuss how SQL Server 2012 uses DML, DDL and DCL to manage databases.
The accompanying table shows the demand schedule for vitamin : The accompanying table shows the demand schedule for Vitamin D. Suppose the marginal cost of producing vitamin D is zero. Suppose that company A is the only producer of vitamin D and act as a monopolist.Suppose the company produces 40 units of vitami..
What indicates an increase in quality of labor in economy : On a bowed out PPC where Q (horizontal axis) is medical services and Z is all other services on the vertical axis. What does a movement from the interior of the cure to a northeasternly oint on the curve indicate? What indicates an increase in the qu..
A case study of gucci- in the fashion industry : How does branding strategies have an impact on consumer buying behavior towards fashion industry in the united kingdom- a case study of GUCCI- in The Fashion Industry
Generate a unique identification number for each object : Generate a unique identification number for each object instantiated from this class. Use a static data member to keep track of the identification number last assigned to an object so that duplications will not occur. Briefly describe what an interfa..
Unique characteristics and critical skills as change agents : Our Iceberg is melting by john Kotter reading and answers the following questions: Who are the key change agents and their roles in the change process? What are their unique characteristics and critical skills as change agents, and the relationships ..
Statements correctly reflects the developments : Which of the following statements correctly reflects the developments in the U.S. automobile industry following an across the board increase in wages paid to auto workers?
Create an economic and management accounting plan : Assume that you have just been hired as a financial consultant to a startup company that plans to introduce a new beverage to the soft drink market. Your company’s product is advertised as a healthier alternative to soda and other artificially flavor..
About the price strategy to adopt for a product : You are in a meeting about the price strategy to adopt for a product your firm is about to introduce into a new market. Jack says, “We should use price skimming.” Jane says, “We should use penetration pricing.” What assumption is Jack making about th..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  How many possible starting lineups are there

how many possible starting lineups are there?

  Research the internet for recent cases near your region

research the internet for recent cases near your region that used digital or computer evidence as a source of

  Software engineering for postgraduates

In software engineering for postgraduates what is the answer to below question Apart from the risks of software projects stated inyour textbook, identify at least six other possible risks that could arise insoftware projects.

  Create a query from an existing query

You will create a relationship between two tables, create a query from an existing query, and create queries using text, numeric, compound, and wildcard criteria based using the fields in one or both tables.

  Remaining apples and he also dozed back to sleep

Finally, Chandan woke up and seeing the others were asleep, took a third of what was left. Of course none of the friends knew of the other's antics, so, in the morning, they shared the remaining apples, each receiving sixteen. How many apples did ..

  Syns and fins each take up one unit in sequence number

Is this necessary? If so, give an example of an ambiguity that would arise if the corresponding Acknowledgment were x instead of x + 1; if not, explain why.

  Value of the expression would be the string

Given a string variable word, write a string expression that parenthesizes the value of word. So if the word contains "sadly" the value of the expression would be the string "(sadly)".

  Whether the byte in question is low order or high order

Give an algorithm to compute the revised checksum without rescanning the entire buffer. Your algorithm should consider whether the byte in question is low order or high order.

  Explain what your process was and how the experiment went

Write a 2- to 3-page paper to explain your choice. Explain what your process was and how the experiment went. Were you successful? What did you learn from the experience ? Experiment choice #1:  File Sharing Program

  What is a communications protocol

What is a communications protocol? What is the relationship between communications protocols and IT infrastructure? What is a network topology? List and define at least three examples of network topologies.

  Given a set of integer numbers

Given a set of integer numbers as int A[ ] = { 12, 6, 51, 4, 3, 7, 19, 8, 0, 21}, please write down the divide and conquer procedure of quick sort (step by step), include all left and right positions adjustment, and overwriting.

  Assignment-cloud computing slide presentation

Image that you are a member of a development team that is creating a large and important web-based application. This application is critical to the company and must be available 24 hours per day.

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