Categories
Study Questions

OOP Assignment

 Files are in the attachment if unable to view.

Overview

Nearly every Java application involves multiple classes. For this assignment, you will work on a Dog application composed of three classes. The Dog and Corgi classes have been started for you; you will complete these classes and create the Driver class from scratch. The application will be used to collect and print details about specific dogs. As you can see from the UML class diagram on this page, the Corgi class (child/subclass) inherits from the Dog class (parent/superclass). In the Corgi class file definition, the “extends” keyword is used to establish that it inherits from the Dog class.

Prompt

For this assignment, you will complete the Dog application by completing the Dog and Corgi classes and creating the Driver class. Use the Uploading Files to Eclipse and the Downloading Files From Eclipse tutorials to help you with this project.

  1. Open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open your IDE and upload the DogApp.zip folder containing the Dog and Corgi class files. You will be creating a Driver class in the same project folder. When you upload the files, you will see errors due to the classes being incomplete. As you complete each class, any errors should resolve.

  1. Complete the Dog class:
    1. Using the UML Class diagram to the right, declare the class variables. A text version is available: UML Class Diagram Text Version.
    2. Create a constructor that incorporates the type, breed, and name variables (do not include topTrick).
      Note: The type refers to what the breed typically does; for example, a corgi would be a “cattle herding dog.” A Shiba Inu would be a “hunting dog.”
    3. Create the setTopTrick() mutator method.
  2. Complete the Corgi class:
    1. Using the UML Class diagram, declare the class variables.
    2. Create the two mutator methods for the class variables.
  3. Make sure to select the Project folder, then add a new class. Name it the Driver class, then create the code:
    1. There should be no class variables.
    2. The main() method will be the only method in the class.
    3. Write three lines of code in the main() method:
      1. Instantiate a corgi object using the below syntax:
        className objectName = new className(input parameters)TIP: Refer to the constructors in the Dog and Corgi classes to ensure the input parameters are correct.
      2. Use the objectName.setTopTrick() method to set a top trick for the dog you created.
      3. Embed the objectName.toString() method in a statement that outputs to the console window.
  4. Once you have completed the code for the Dog and Corgi classes and created a Driver class, right-click the Project folder and select Run As, then Java Application. You should see output in the Console window that resembles the sample below. Your results will vary based on your input values.

Sample Output

DOG DATA
Java is a Pembroke Welsh Corgi, a cattle herding dog.
The top trick is: ringing the bell to go outside.
The Corgi is 5 years old and weighs 38 pounds. 

This page is having a slideshow that uses Javascript. Your browser either doesn't support Javascript or you have it turned off. To see this page as it is meant to appear please use a Javascript enabled browser.

Jessy
Jessy
Just a bit off from the syllabus rubric, but I can add to the slides on my own. Thank you anyway.
Alvin
Alvin
To the writer, THANK YOU, a million times over, this is very impressive! Thank you to the support team for making a hiccup not turn into a disaster!
Milly.P
Milly.P
There was consistent communication from the start, and it was obvious the writer thoroughly reviewed the information provided. Thank you.
Ivy.G
Ivy.G
Excellent work all the time! love my writer also. Don't know if I'm supposed to do this but I just need to say this writer does excellent work!
Emily.s
Emily.s
The writer followed my instruction thoroughly and did a great job. The quality of the paper is more than I expected. Thank you.
Justus N
Justus N
You people have been really patient with me as I created mechanical engineering content. It’s not an easy topic to handle, yet I can say that I worked with a skilled specialist. My writer took time to understand my ideas but it was mostly my fault. Just share more details.
Kelly H
Kelly H
When I received a paper revision from my new college professor, I was desperate as I didn’t know what to do. If not for Academized, I would be doomed. They know how to fix things for you and explain what was wrong as they fix it.
Paul D
Paul D
You're the best, I'll be using your services again soon! Thank you Thank you Thank you!
Mark P.
Mark P.
I asked my writer to help me compose a personal essay about charity work that I do at the local church. It is not easy for me to express myself in words, which is why I needed some privacy and a good person who would appreciate my thoughts and ideas.

error: Content is protected !!
Open chat
1
Do You Need Assignment Help? Lets Chat!
StudyPoo Inc.
Get Help Instantly direct from an Expert.

Talk through Live Chat right now!