Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I posted this question already but someone copied someone else's answer so I will try again. I am currently working on a project and only

I posted this question already but someone copied someone else's answer so I will try again.

I am currently working on a project and only need to draw my Flowchart. (Check the flowchart below and draw it)

DO NOT COPY other answers from Chegg since it is not possible in this case. I will make sure to thumbs up for an original answer only. Thank you in advance.

All that is required in this question is this Flowchart drawn by you:

Flowchart:

[Start]

|

|

[Declare variables]

|

|

[Create Pet constructor]

|

|

[Create accessor methods]

|

|

[Create mutator methods]

|

|

[Create petCheckIn method]

|

|

[Check if Pet is already checked in]

|

|

[Yes] Return error message

|

[No]

|

[Set checkInDate]

|

[Return confirmation message]

|

[End]

Below I will post the instructions and also attach my Code and Pseudocode that may help you.

Again, all I need is someone to DRAW the flowchart above.

image text in transcribed

Instructions:

You work for Global Rain, a software engineering company that specializes in custom software design and development. As a junior software developer, you are part of a software development team that collaborates to create solutions for entrepreneurs, businesses, and government agencies around the world.

As part of a development team at Global Rain, you will be designing and developing custom software for a local pet boarding and grooming business, Pet Boarding and Grooming (Pet BAG). Pet BAG is seeking a way to modernize its operations by introducing custom software that will help replace inefficient paper-based processes. Your Global Rain team will collaborate to develop an app that will have the following initial functional areas: pet check in and pet check out.

As part of this team, you have been tasked with completing some preliminary work that consists of writing a Java class, writing pseudocode, and creating a flowchart. You will provide these deliverables to your supervisor.

Your supervisor has given you a specification document which details Pet BAGs software needs and includes a UML Class diagram. Using these documents, you will create both a Java class and a summary report. Your summary report will include pseudocode and a flowchart for one method (pet check in or pet check out), and an explanation of how your work meets object-oriented principles.

Before you begin, it is important to understand what your client needs the software to do, and what work has already been done by your team. Review the Pet BAG Specification Document, located in the Supporting Materials section, which includes a UML Class diagram. Pay close attention to the class hierarchy, attributes, and behaviors.

To begin, open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open your integrated development environment (IDE) and create the Pet class based on the specifications in the UML Class diagram. The Pet class must include the following:

All attributes with appropriate data structures. Note that the types are not specified in this UML class diagram. You will need to think about what the most appropriate data type is for each attribute.

At least one constructor method. You may use a default constructor. To score exemplary on this criterion, your constructor must initialize values for the petType, petName, petAge, and daysStay attributes.

Accessors and mutators for all attributes

Note: You are only being asked to create one class. Though the UML diagram shows the Pet class as part of a larger application, for this project, you are not required to connect it to other classes or to try and run it as a program. Instead, you are practicing the skill of creating a class from a UML Class diagram.

When you are done implementing the Pet class, refer back to the Pet BAG Specification Document and select either the pet check in or check out method. These methods are detailed in the Functionality section of the specification document.

Open the summary report template, located in the What to Submit section. In the template, write pseudocode that lays out a plan for the method you chose. Ensure that you organize each step in a logical manner and that your method meets the specifications in the document for either the check in or check out process. Your pseudocode must not exceed one page.

Note: Remember, you will not be creating the actual code for the method, and you do not have to write pseudocode for both methods.

Based on the pseudocode you wrote, create a flowchart using a tool of your choice for the method you selected. Your flowchart will help your team communicate how you are planning to develop the software for your client. Your flowchart must be confined to one page. In your flowchart, be sure to do the following:

Include start and end points.

Include appropriate decision branching.

Align the flowchart to the check in or check out process.

Note: You may draw your flowchart by hand and take a clear picture of it, or you may use a flowcharting tool. Refer to the Supporting Materials section to help you insert your flowchart into your summary report.

Based on your software design and development experience, your supervisor has asked you to articulate your programming approach. This will help ensure clarity, consistency, and efficiency among all developers working on this app. Specifically, you have been asked to briefly explain how you applied object-oriented programming principles and concepts (such as encapsulation, inheritance, and so on) in your software development work thus far. Your explanation should be one paragraph, or four to six sentences.

I am attaching code for all files:

Pet.java Dog.java Cat.java Main.java

Pet.java:

import java.util.Scanner; import java.util.Dictionary; import java.util.HashMap; import java.util.Map;

public class Pet { private String petType; private String petName; private int petAge; private Map dogSpace; // contains the Pet and days it is staying private Map catSpace; // same but for cats private int daysStay; public double amountDue;

/** * Pet, base class for Dog and Cat * @param String name - Name of the Pet * @param int age - Age of the Pet * @param String type - Cat | Dog */ public Pet(String name, int age, String type) { this.petName = name; this.petAge = age; this.petType = type; this.dogSpace = new HashMap(); // use a hashmap to keep track of pets in the shelter this.catSpace = new HashMap(); // the Pet object is the key, and the days they are staying is the value. }

public void checkIn(Pet pet) { Scanner in = new Scanner(System.in); System.out.println("How many days will your " + this.petType + " be staying?"); int days = (int) in.nextInt(); this.daysStay = days;

switch(this.petType) { case "Dog": if(days > 1) { System.out.println("Do you require grooming services?"); String needsGrooming = in.next(); boolean grooming; if(needsGrooming.equals("yes") || needsGrooming.equals("y")) { System.out.println("We will groom your dog... "); grooming = true; } else { grooming = false; } this.checkInDog((Dog) pet, days, grooming); // handle the special dog cases } else { this.checkInDog((Dog) pet, days, false); } break; case "Cat": if(this.catSpace.size()

/** * Check out the desired Pet and calculate how much is owed for the boarding. * @param pet - The pet you wish the check-out. * @return amountDue - The amount of money owed for the boarding. */ public double checkOut(Pet pet) { double fee;

if(pet.getPetType() == "Dog") { double groomingfee = 0.0;

Dog animal = (Dog) pet; int days = this.dogSpace.remove(pet); double weight = animal.getDogWeight(); if(weight 20 && weight

public Pet getPet(Pet pet) { // Not sure why we need this. return pet; }

public Pet createPet(String name, int age, String type) { switch(type) { case "Dog": return new Dog(name, age); case "Cat": return new Pet(name, age, "Cat"); // I have implemented the dog class, not the cat. default: throw new Error("Only Dogs and Cats can stay at this facility."); } }

/** * Asks the user to fill in all of the attributes of a pet. Saves them directly to the object it was called on. * @param pet - The pet you wish to update information on. */ public void updatePet(Pet pet) { Scanner in = new Scanner(System.in); System.out.println("What is the pets new name?"); pet.setPetName(in.next()); System.out.println("What is the pets age?"); pet.setPetAge(in.nextInt()); System.out.println("What type of animal is your pet?"); pet.setPetType(in.next()); in.close(); }

public String getPetName() { return this.petName; }

public int getPetAge() { return this.petAge; }

public String getPetType() { return this.petType; }

public void setPetName(String name) { this.petName = name; }

public void setPetAge(int age) { this.petAge = age; }

public void setPetType(String type) { switch(type) { // while a switch is extra here, it will make it easier to add other pets. case "Dog": this.petType = type; break; case "Cat": this.petType = type; break; } } public void setDaysStay(int days) { this.daysStay = days; } }

Dog.java:

public class Dog extends Pet { public int dogSpaceNbr; private double dogWeight; private boolean grooming;

public Dog(String name, int age) { // automatically declares a pet of type Dog super(name, age, "Dog"); // super is used to call the parent classes constructor }

public double getDogWeight() { return this.dogWeight; }

public boolean getGrooming() { return this.grooming; }

public void setDogWeight(double weight) { this.dogWeight = (double) weight; // casting a double here might be redundant, but it helps us to be sure } // we don't get at type error

public void setGrooming(boolean value) { this.grooming = value; } }

Cat.java:

public class Cat extends Pet { private int catSpaceNbr; // The number space the cat is in. public Cat(String name, int age) { // automatically declares a pet of type Cat super(name, age, "Cat"); // Calls the constructor of the parent class } public int getCatSpace() { return this.catSpaceNbr; } public void setCatSpace(int number) { this.catSpaceNbr = number; } }

Main.java:

public class Main { public static void main(String args[]) { Pet pet = new Pet("Spot", 12, "Dog" ); System.out.println("Pet name is " + pet.getPetName());

Dog dog = new Dog("Pepper", 15); System.out.println("" + dog.getPetName() + " is " + dog.getPetAge() + " years old."); Cat cat = new Cat("Bailey", 5); System.out.println("" + cat.getPetName() + " is " + cat.getPetAge() + " years old."); pet.checkIn(dog); double price = pet.checkOut(dog); System.out.println("You owe " + price + "."); } }

image text in transcribed

image text in transcribed

Here is the Pseudocode: Pseudocode: 1. Declare variables for petType, petName, petAge, and daysStay. 2. Create a Pet constructor method that initializes values for petType, petName, petAge, and daysStay. 3. Create accessor methods for all variables. 4. Create mutator methods for all variables. 5. Create a petCheckln method that takes in a Pet object and a date as parameters. 6. Check if the Pet object is already checked in by looking at its checkinDate attribute. 7. If the Pet is already checked in, return an error message. 8. If the Pet is not checked in, set the checklnDate to the given date and return a confirmation message. C:XWindows\System 32 \cmd.exe Microsoft Windows [Version 10.0.18363.1139] (c) 2019 Microsoft Corporation. All rights reserved. A: \CheggP\304>javac Main.java A: \CheggP\ \04> java Main Pet name is Spot Pepper is 15 years old. Bailey is 5 years old. How many days will your Dog be staying? 10 Do you require grooming services? Yes Pepper will miss you, but is in good hands. Fee Schedule: Boarding Fee: 240.0 Grooming Fee: 0.0 You owe 240.0. A:\ CheggP\ 304> Directions Place your pseudocode, flowchart, and explanation in the following sections. Before you submit your report, remove all bracketed text. Pseudocode When you are done implementing the Pet class, refer back to the Pet BAG Specification Document and select either the pet check in or check out method. These methods are detailed in the Functionality section of the specification document. Write pseudocode that lays out a plan for the method you chose, ensuring that you organize each step in a logical manner. Remember, you will not be creating the actual code for the method. You do not have to write pseudocode for both methods. Your pseudocode must not exceed one page. [Type or copy your pseudocode here.] Flowchart Based on the pseudocode you wrote, create a flowchart using a tool of your choice for the method you selected. In your flowchart, be sure to include start and end points and appropriate decision branching, and align the flowchart to the check in or check out process. Your flowchart must be confined to one page. [Insert your flowchart image here. Refer to the Project One Supporting Materials for tool options to create your flowchart and support for copying images into this template.] OOP Principles Explanation Briefly explain how you applied object-oriented programming principles and concepts (such as encapsulation, inheritance, and so on) in your software development work thus far. Your explanation should be one paragraph, or four to six sentences. [Type your explanation here.] Here is the Pseudocode: Pseudocode: 1. Declare variables for petType, petName, petAge, and daysStay. 2. Create a Pet constructor method that initializes values for petType, petName, petAge, and daysStay. 3. Create accessor methods for all variables. 4. Create mutator methods for all variables. 5. Create a petCheckln method that takes in a Pet object and a date as parameters. 6. Check if the Pet object is already checked in by looking at its checkinDate attribute. 7. If the Pet is already checked in, return an error message. 8. If the Pet is not checked in, set the checklnDate to the given date and return a confirmation message. C:XWindows\System 32 \cmd.exe Microsoft Windows [Version 10.0.18363.1139] (c) 2019 Microsoft Corporation. All rights reserved. A: \CheggP\304>javac Main.java A: \CheggP\ \04> java Main Pet name is Spot Pepper is 15 years old. Bailey is 5 years old. How many days will your Dog be staying? 10 Do you require grooming services? Yes Pepper will miss you, but is in good hands. Fee Schedule: Boarding Fee: 240.0 Grooming Fee: 0.0 You owe 240.0. A:\ CheggP\ 304> Directions Place your pseudocode, flowchart, and explanation in the following sections. Before you submit your report, remove all bracketed text. Pseudocode When you are done implementing the Pet class, refer back to the Pet BAG Specification Document and select either the pet check in or check out method. These methods are detailed in the Functionality section of the specification document. Write pseudocode that lays out a plan for the method you chose, ensuring that you organize each step in a logical manner. Remember, you will not be creating the actual code for the method. You do not have to write pseudocode for both methods. Your pseudocode must not exceed one page. [Type or copy your pseudocode here.] Flowchart Based on the pseudocode you wrote, create a flowchart using a tool of your choice for the method you selected. In your flowchart, be sure to include start and end points and appropriate decision branching, and align the flowchart to the check in or check out process. Your flowchart must be confined to one page. [Insert your flowchart image here. Refer to the Project One Supporting Materials for tool options to create your flowchart and support for copying images into this template.] OOP Principles Explanation Briefly explain how you applied object-oriented programming principles and concepts (such as encapsulation, inheritance, and so on) in your software development work thus far. Your explanation should be one paragraph, or four to six sentences. [Type your explanation here.]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions