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

  Static friction between the pin and the bell crank

The bell crank fits loosely into a 0.5-in-diameter pin. If P = 41 lb, the bell crank is then on the verge of rotating counterclockwise. Determine the coefficient of static friction between the pin and the bell crank

  Where does the data appear in the file and why

Where does the data appear in the file

  Create an itt technical institute student project management

You have volunteered to help create an ITT Technical Institute student project management group. You have been asked by the chair of the business school to develop a simple project plan to show the intended activities, to ensure a student group will ..

  Greatest challenge for system forensics investigators

Describe what you perceive to be the greatest challenge for system forensics investigators. Provide specific details of this challenge and whether or not the challenge differs from a private company investigation compared to a law enforcement inve..

  The sum of the angles of a triangle is always 180

The sum of the angles of a triangle is always 180. Get two angles from the user and display what the final angle must be in order to complete the triangle. Run the program to see the exact format of the output.

  Create a new account for a new customer

You have been asked to write a program to organize accounts in a bank. Suppose all the accounts are stored in a data file called account.dat.

  Case study - casey anthony trial

Determine whether the software issue, which caused inaccurate evidence in the trial, would've affected your perception of the prosecution's case if you were a juror in this trial.

  Write a set of rules combining the secrecy controls

Write a set of rules combining the secrecy controls of the Bell-La Padula model with the integrity controls of the Biba model.

  What is required to apply it into business

Does business need IT? Why IT is important for business survival? What is required to apply IT into business? (Cost, planning, designing, equipment, installation, training, etc) How does business use IT? (internally such as staff, employees, and exte..

  Write a function called tallenough

(function, two-way if statement) Write a function called tallEnough() that takes a single parameter, the user's height in inches. If the height is 48 or more, the function should return "You can go on this ride." Otherwise it should return the str..

  Computing exact speed of a t1 line

Below what speed are there different leased line standards in different parts of the world? What is the exact speed of a T1 line?

  Er dagiram developed in visio

Perform conceptual design for the following case. You must turn in an ER diagram developed in VISIO. You may include, in your ER Diagram, specifications that include additional constraints not shown on the diagram. The specifications should be wri..

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