Demonstrate the use of one accessor method

Assignment Help Other Subject
Reference no: EM132608717

CSC72002 Object Oriented Programming - Southern Cross University

Specifications

Your task is to complete various exercises in NetBeans, using the Java language, and to submit these via the MySCU link created for this purpose.

Marking criteria includes:
• Use of correct coding style, including the use of comments;
• Accuracy of coding;
• Use of suitable coding structures;
• Correct submission and naming conventions of assessment items as required.

Getting Help
This assignment is to be completed individually. It is the opportunity to gain an understanding of the concepts of object-oriented programming and coding syntax. It is important that you master these concepts yourself. You are permitted to work from the examples in the study guide or textbook, but you must acknowledge assistance from other textbooks or classmates. In particular, you must not use online material or help from others, as this would prevent you from mastering these concepts.

Part 1 - Classes and objects
Create a new Java project called usernamePart1 in NetBeans. In my case, the project would be called pdarcyPart1. Select the option to create a main method.
Create a new class called ArtObject. In the Art Object class, write the code for:
• Instance variables that store the art object's title, artist, year created, and description.
• A default constructor, and a second constructor that initialises all the instance variables.
• Accessor (getters) and mutator (setters) methods for all instance variables.
• A method called printDetails that prints the ArtObject details, e.g. "The Art Object details are:"
followed by all instance variables. The output must be formatted for readability.

In the main method, write the code to:
• Create 2 art objects, one using the default constructor, the other using the constructor that initialises all the instance variables for the art object.
• Demonstrate the use of one accessor method and one mutator method for one of the art objects you created.
• Print the art object's details using the printDetails method for one of the art objects you created.

Part 2 - Inheritance, collections and polymorphism
Create a new Java project called usernamePart2 in NetBeans. Select the option to create a main method.
Create a new class called Sculpture. Create a second class called ArtObject. Copy the code from the ArtObject class you created in Part 1 into the new ArtObject class.
Modify the new Sculpture class so that it extends ArtObject class (ArtObject is the superclass, Sculpture is the subclass).
In the Sculpture class, write the code for:
• The instance variables that store the height, and weight.
• Accessor and mutator methods for the 2 instance variables.
• A default constructor, and a second constructor that initialises all the instance variables in the Sculpture and the ArtObject classes using the super keyword.
• The ArtObject class has a method called printDetails that prints the ArtObject details. Override the printDetails method in the Sculpture class and print all of the sculpture's details. The printDetails method in the Sculpture class must use the super keyword to call the printDetails method in the ArtObject class.
• The Sculpture class must also demonstrate the use of overloaded methods.

In the main method, write the code to:
• Declare an ArrayList with a type parameter of Sculpture.
• Add at least 2 sculptures to the ArrayList.

• Use an Iterator (java.util.Iterator) to loop through the sculptures in the ArrayList and print out some of their details. Please note that use of any other kind of loop will not receive any marks.
• Check if the ArrayList contains a particular sculpture.
• Get a sculpture from the ArrayList.
• Remove a sculpture from the ArrayList.
• Print the size of the ArrayList.
• Clear the ArrayList.
Please note that collections are covered in Topic 3 and 4. You may need to wait until we have covered these topics to implement your ArrayList.

Polymorphism
In the class that contains the main method, create a second method that takes an art object's as a parameter and write the code to print out the art object's artist using one of the ArtObject's accessor methods. Then create an object of type Sculpture and an object of type ArtObject in the main method and use the method you have just created to demonstrate polymorphism.

Part 3 - Abstract classes
Create a new Java project called usernamePart3 in NetBeans. Select the option to create a main method.
Create a new class called Sculpture. Create a second new class called ArtObject. Rewrite your code from Part2 so that:
• The ArtObject class is abstract
• Sculpture extends ArtObject
• The ArtObject class contains at least one abstract method
All methods, constructors and instance variables that were in the Sculpture and ArtObject classes in part 2 must be included in part 3. You need to rewrite the Sculpture and ArtObject classes from part 2 so that ArtObject is abstract and there are multiple ways to create a sculpture.
Check your code works by creating a new sculpture in your main method.

Part 4 - Interfaces
Create a new Java project called usernamePart4 in NetBeans. Select the option to create a main method.
Create a new class called Sculpture. Create a new interface called ArtObject. Rewrite your code from Part 2 so that:
• ArtObject is an interface
• Sculpture implements ArtObject
• The ArtObject interface contains at least one abstract methods

All methods, constructors and instance variables that were in the Sculpture and ArtObject classes in part 2 must be included in part 4. You need to rewrite the Sculpture and ArtObject classes from part 2 so that ArtObject is an interface and there are multiple ways to create a sculpture.
In the main method of your project, write the code to:
• Declare a Stack with a type parameter of Sculpture
• Add at least 3 sculptures to the Stack
• Demonstrate the use of:
o peek()
o pop()
o empty()

Part 5 - UML
Create a word document called usernamePart5. Draw 2 UML diagrams to show the inheritance relationship for the Art Object and Sculpture in part 3 and part 4. Make sure that each diagram has a heading and the header of the word document contains your name and student ID.

Attachment:- Object Oriented Programming.rar

Reference no: EM132608717

Questions Cloud

What is the weighted average after tax cost of capital : Short Term Debt with a cost of 7%, and $2 million preferred stock with a cost of 3%, what is the Weighted Average after tax Cost of Capital?
ERM at Malaysia Media company Astro : Case study on ERM at Malaysia's Media company Astro. how ERM can be used to assess portfolio performance.
Find tony will record property tax expense of : According to the bill, taxes of $24,000 for the year ended December 31, 2021 are due by April 30, 2021. On March 1, Tony will record property tax expense of
Describe the attributes needed to achieve the role : In a 1-2 page Word document, describe the attributes needed to achieve this role for the client. Explain how you are best equipped to fulfill this role.
Demonstrate the use of one accessor method : Create a new Java project called usernamePart4 in NetBeans and Create a new class called Sculpture. Create a second new class called ArtObject
Phases of incident response : Consider the phases of incident response listed below. Recovery and Repair. Debriefing and feedback.
What capital cost is assigned to the land : Manager is currently on-site facilitating the production startup. This manager is an annual salary of $85,000. What capital cost is assigned to the land?
How does model measure effect of the process change : The data in the table are from a study conducted by an insurance company to determine the effect of changing the process by which insurance claims are approved.
Prepare the journal entries if any to record the impairment : Determine if the machinery and the mine are impaired and prepare the journal entries, if any, to record the impairment at June 30, 2020.

Reviews

Write a Review

Other Subject Questions & Answers

  Treated differently in the criminal justice system

Can you think of examples both as victims and defendants in court?

  Discuss the influence of culture on mental health care

Describe and discuss the influence of culture on mental health care values, beliefs, and practices. Identify and discuss specific cultural values, beliefs.

  What is the expected return on a portfolio

What is the expected return on a portfolio

  Invested time and money developing a unique new product

Once a company has invested time and money developing a unique new product, in order to recoup some of the high R&D costs, they will likely use a: Generally, entrepreneurs should avoid head-to-head price competition with other firms that can more eas..

  How is the group a social group

GOVT 2305:Find a competing group (either a group on the opposite side of the issue or a group that is competing with them for resources) and describe them.

  Exercise more or less control over behavioral research

To gain practice writing an informed consent form, write one for the Milgram study described. Be sure to include all of the elements needed in an informed consent form.

  Occupational and environmental health course-disability act

The American with Disability Act (ADA) is recognized in relation to civil- rights because it fights against discrimination. This project is designed to offer a learning opportunity about the many difficulties and challenges in advancing the main goal..

  Brainstorming or idea mapping

Set a timer for five minutes. Use brainstorming or idea mapping to create a list of topics you would be interested in researching

  Function of modern-day psychologists

Conducting an experiment to determine if watching violent cartoons increases aggressive behavior in preschoolers, c) Videotaping an intersection with four-way stop signs and measuring the ratio of complete to incomplete stops made by drivers

  Examine the change in amphetamine use and abuse in the us

Aaliyah decides to take an amphetamine to stay awake to study for the exam. She promises herself that she will only take it this one time for the exam. The drug allows her to stay awake and alert while she is studying for the exam. She also feels ..

  Identify specific messages about gender in the mass media

SOCW 6051 Identify specific messages about gender presented in the mass media. Discuss messages about gender you have received from your family or cultural.

  Rawlinson use in attacking the height and weight requirement

What method of proving a Title VII case should Rawlinson use in attacking the height and weight requirements

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