Description of the problems-uml diagrams

Assignment Help JAVA Programming
Reference no: EM131035650

For this assignment, you can use BlueJ or any other IDE tool of your choice.

You have the choice to work alone or in groups of  two.

This is the last main programming assignment for the semester and it requires a formal report. The report should look like a technical documentation that has enough information for another software engineer to understand, update and/or extend your code.

The main components that should be included in the report are brief description of the problems, the UML diagrams, and your approach to solving the problems. In the report, you should explain the data fields used, the classes, and the methods along with their corresponding implementation. Also the report must include multiple snapshots of the outputs covering all the requirements.

Upload the short report, .java files and .class files as one zip file to blackboard.

Task 1:

Redo Task 3 of assignment 4 using objects. You need to create a class named Student that has the appropriate data fields and methods. Example of methods in class Student is StudentAverage to find the average of each student and StudentLetterGrade to find the corresponding letter grade of the student. To cover all the students in the class, create an array of objects where each object is a student.

Task 2:

Technical Requirements for Deliverable A:

1. Create three public classes: one named App, one named Pet and one named PetOwner. The App class has a static void main method that performs all the actions for the Deliverable A and Deliverable B requirements.

2. The PetOwner class must have private fields for the following state information. Create a private field to represent each of these states, each field should default to null, zero, or false values as appropriate:

  • Owner First Name (a simple string for storing the first name of the  owner)
  • Owner Last Name (a simple string for storing the first name of the  owner)
  • Owner Address (a simple string for storing the mailing address in one  line)
  • An integer value for the number of pets currently owned by this  owner
  • An integer value for the maximum number of pets that the owner has EVER owned (now  or in the past)

3.  The PetOwner class must have public accessor methods for accessing the following state information:

  • Owner First Name (a simple string for storing the first name of the  owner)
  • Owner Last Name (a simple string for storing the first name of the  owner)
  • Owner Address (a simple string for storing the mailing address in one  line)
  • A boolean value representing whether the owner currently has a pet or  not
  • An integer value for the number of pets currently owned by this  owner
  • A boolean value whether the owner has ever owned a pet (either now or in the past)
  • An integer value for the maximum number of pets that the owner has EVER owned (now or in the past)

4.  The PetOwner class must have public mutator methods for modifying the following state information:

  • Owner First Name (a simple string for storing the first name of the  owner)
  • Owner Last Name (a simple string for storing the first name of the  owner)
  • Owner Address (a simple string for storing the mailing address in one  line)

5.  The PetOwner class must maintain all the state information (as mentioned above). In other words, the program must set these values correctly; but this can be done via public mutators, public helpers, or and other methods described in this  document:

For example: when the first pet is added, the pet owner must update the state to reflect that there now one pet currently owned, and also update the other state information as well. Contrariwise, if the last pet is removed, the number of pets currently owned would be zero, the pet owner would know that they do not currently own any pets, but also that they had owned one pet in the past.

6.  The PetOwner must also be capable of storing a reference to each of the actual Pets currently owned by this owner (if there are any).

Each Pet owned by this PetOwner will be added by invoking a public method declared within PetOwner class, whose signature is

public void addPet(Pet p) throws Exception

Each PetOwner object can own any number from zero (0) up to five (5) pets.

You can define other private state fields and methods to implement this as you see fit.

If 5 pets are already owned, an exception with a message like this must be thrown: "Unable to add Pet: <pet-name>\n

because too many pets already owned by PetOwner: <first-name>" (replace <first-name> with the value of the pet owner's actual first  name)

If the p parameter is null, an exception with a message like this must be thrown: "Unable to add Pet because it is null"

7.  A PetOwner object must be able to print all its state information including the details for all pets currently owned with a public method whose signature is public void dump(). The dump method should output the name of a field followed by its value on a single line in a readable fashion. For example, if we had a PetOwner object named "George Jetson" who lived at "123 Milky way" and owned one Pet (a dog named "Astro" who eats "Milky-Way Bones") we would see output something like this:

Owner First Name : George Owner Last Name : Jetson Owner Address : 123 Milky way

Owner Number of Current Pets : 1 Owner Currently Has a Pet : true Owner Has Ever Owned a Pet : true

Owner Maximum Number of Current-and-Past Pets: 1 Pet Type: dog

Pet Name: Astro

Pet Food: Milky-Way Bones

8.  The Pet class must have private fields with public accessor and mutator methods for the following state information: (again all fields should default to null  values)

  • Pet Type (a string describing the type of pet that it  is)
  • Pet Name (a string containing the pet's name)
  • Pet Food (a string describing what the pet likes to  eat)

9. The Pet class must be able to print all its state information with a public method whose signature is public void dump() (similar formatting / readability  considerations).

10. Create a runable program that meets the running requirements and output, the technical requirements for Deliverable A, and is capable of running the following execution requirements (invoked directly or indirectly from the main method in your App  class).

Execution Requirements for Deliverable A:

1st. Create a pet object representing Puff, a dragon, who eats Knights of the Round  Table.

2nd. Create pet owner object representing Jackie Paper, who lives at 123 Main Street, and currently owns Puff, the dragon.

3rd. Create a pet object representing Tux, a penguin, who eats  Fish.

4th. Use the addPet method to modify the state of the pet owner object representing Jackie Paper, to indicate that he is now also the owner of Tux the  penguin.

5th. Invoke the dump method for the pet owner object representing Jackie Paper    6th. Create a pet object representing Dino, a dinosaur, who eats Brontosaurus  steaks.

7th. Create pet owner object representing Wilma Flintstone, who lives at 456 Bedrock Road, and currently owns Dino, the dinosaur.

8th. Create a pet object representing Barney, a dinosaur, who eats  Plants.

9th. Use the addPet method to modify the state of the pet owner object representing Jackie Paper, to indicate that he is now also the owner of Barney the  dinosaur.

10th. Invoke the dump method for the pet owner object representing Jackie Paper.  11th. Invoke the dump method for the pet owner object representing Wilma  Flintstone.

Deliverable B:

Technical Requirements for Deliverable B:

a)  Add code to the PetOwner class capable of returning a pet object based upon the type and name details for the pet (if it is currently owned) with a public method whose signature  is:

public Pet findPet(String type, String name) throws  Exception

If the type parameter is null, then an exception with a message like this must be thrown: "Unable to findPet because type is null."

If the type parameter is not null, but the name parameter is null, then an exception with a message like this must be thrown:

"Unable to findPet because name is null."

If there is no pet owned the method should return  null.

If none of the pets owned have the same type and same name as specified in the parameters,  the method should return null. Note: when searching for the pet object, the type and name should be compared case-sensitively. For example name "Astro" (with uppercase A) will not match a pet whose name is "astro" (with lowercase  a).

If a pet with the same type and name as specified is owned, return a reference to it. If there are multiple pets with the same type and name as those specified, return a reference to one of them (there is no specified precedence order).

b)  Add code to make the PetOwner capable of removing a pet object (if it is currently owned) with a public method whose signature is

public void removePet(Pet p) throws  Exception

If the pet parameter is null, then an exception with a message like this must be thrown: "Unable to remove pet because it is null."

If the pet does not exist, then an exception with a message like this must be  thrown:

"Unable to remove pet because PetOwner: <first-name> does not    own a pet <pet-type> named

<pet-name>." (replace the place holders with actual state  values)

If the specified pet is owned by this owner, then this method should update the pet owner object's state to reflect the removal of the pet (e.g. updating the number of pets currently owned, etc.).

c) Create a runable program that meets the running requirements and output, the technical requirements for Deliverable B, and is capable of running the following execution requirements (invoked directly or indirectly from the main method in your App  class).

Execution Requirements for Deliverable B:

12th. Continuing from the 11th step of Deliverable A, find a pet (using the findPet method) of type dinosaur with name Dino from the pet owner object representing Wilma  Flintstone.

13th. Invoke the dump method on the pet returned from the 12th   step.

14th. Use the removePet method to modify the state of the pet owner object representing Wilma Flintstone, to indicate that she is no longer the owner of the pet returned from the 12th step.

15th. Use the removePet method to modify the state of the pet owner object representing Jackie Paper, to indicate that he is no longer the owner of the pet returned from the   12th step.

16th. Use the addPet method to modify the state of the pet owner object representing Jackie Paper, to indicate that he is now also the owner of the pet returned from the   12th step.

17th. Invoke the dump method for the pet owner object representing Jackie Paper.  18th. Invoke the dump method for the pet owner object representing Wilma  Flintstone.

19th. Find a pet of type dragon with name Puff from the pet owner object representing Jackie Paper.

20th. Modify the state of the pet object returned from the 19th step, so that he now eats Knights in shining armor.

21st. Invoke the dump method for the pet owner object representing Jackie  Paper.

22nd. Find a pet of type penguin with name Tux (using the findPet method) from the pet owner object representing Jackie Paper.

23rd. Invoke the dump method on the pet returned from the 22nd step.

24th. Use the removePet method to modify the state of the pet owner object representing Jackie Paper, to indicate that he is no longer the owner of the pet returned from the 22nd step.

25th. Use the addPet method to modify the state of the pet owner object representing Wilma Flintstone, to indicate that she is now also the owner of the pet returned from the   22nd step.

26th. Find a pet of type dinosaur with name Barney (using the findPet method) from the pet owner object representing Wilma Flintstone.

27th. Invoke the dump method on the pet returned from the 26th step.

28th. Use the removePet method to modify the state of the pet owner object representing Wilma Flintstone, to indicate that she is no longer the owner of the pet returned from the 26th step.

29th. Invoke the dump method for the pet owner object representing Jackie Paper.  30th. Invoke the dump method for the pet owner object representing Wilma  Flintstone.

Attachment:- PetOwner.java

Reference no: EM131035650

Questions Cloud

Determine the maximum coefficient of static friction : The cone has a weight W and center of gravity at G. If a horizontal force P is gradually applied to the string attached to its vertex, determine the maximum coefficient of static friction for slipping to occur.
The company break-even point : BREAK-EVEN ANALYSIS A company's fixed operating costs are $ 500,000, its variable costs are $3 00 per unit, and the product's sales price is $4 00. What is the company's break-even point; that is, at what unit sales volume will its income equal it..
Declared mentally incompetent by a court : Julian Makepeace, who had been declared mentally incompetent by a court, sold his diamond ring to Golding for value. Golding later sold the ring to Carmichael for value. Neither Golding nor Carmichael knew that Makepeace had been adjudged mentally in..
Find the optimal contract for the two types of workers : Find the optimal contract for the two types of workers in the full information setting. Now consider the hidden information setting.  Write the low-productivity worker's participation constraint and the high-productivity worker's incentive compatib..
Description of the problems-uml diagrams : The main components that should be included in the report are brief description of the problems, the UML diagrams, and your approach to solving the problems. In the report, you should explain the data fields used, the classes, and the methods alo..
Identify the crashed network critical path : Using the information in the completed PERT Network Diagram 2 and Table 5, crash the network in order to reduce the estimated project duration to 31 weeks while minimizing the overall crash cost. Which critical path activity would be the most logi..
Entered into an agreement with ups supply chain solutions : Ethicon, Inc., a pharmaceutical company, entered into an agreement with UPS Supply Chain Solutions, Inc., to transport pharmaceuticals. Under a contract with UPS’s subsidiary, Worldwide Dedicated Services, Inc., International Management Services Co. ..
Speculate on the planning mechanism : Per the text, planning isn’t just what you do to go into business; it’s what you have to do to stay in business. Speculate on the planning mechanism(s) that you believe would work well for your business if implemented properly. Provide a rationale fo..
How should marketing strategy differ across these products : Name two product categories for which the brand is generally selected first and the outlet second, two for which the reverse is true, and two for which these decisions are generally made simultaneously. Justify your selections. How should marketing s..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program to play a variation of the game

Roll two dice. Each die has six faces representing values 1, 1, ..., and 6. Check the sum of the two dice. If the sum is 2, 3, or 12 you lose; if the sum is 7 or 11, you win. If the sum is another value (4,5,6,8,9, or 10) a point is established.

  What are operator overloading rules?

What are operator overloading rules?

  Prevent clear communication

Conversational implicature always prevents clear communication - Describe a situation where communication between you and a co-worker

  You have to create a world class that contains a 2d array

you have to create a world class that contains a 2d array then create an abstract class called organism that contains

  Main method to test a student graduate record examination

I need a Java solution named TestGRE.java with a main method to test a Student Graduate Record Examination Score Managment System using BinarySearchTree java classes.

  Get input for the grade letter in string format.

Use the grading criteria from this course for the numbers. (you must use charAt( ) so the string will work with your switch)

  Write a program in java that reads contents of two vectors

Write a program in Java that reads contents of two vectors, and then displays the sum of these two vectors. The program should prompt the user to enter the size of the vectors first.

  Your task for this project is to design a program to help a

your task for this project is to design a program to help a videorental store operatorrecord clients transactions.nbsp

  Write a recursive program to compute the number of ways in

write a recursive program to compute the number of ways in which an integer k can be written as sum each of whose

  Design implement test and debug a program with a jframe

design implement test and debug a program with a jframe that allows the user to enter a series of contacts names ages

  Mean and standard deviationwrite a program that reads a set

mean and standard deviation.write a program that reads a set of floating-point data values from the input. when the

  Once getting into student information menu

Once getting into student information menu, you should be able to see a full list of students' information (first name, last name, SSN, DOB, year and major).

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