Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA PLEASE. There are two main parts to this assignment. 1. Write a project and package that contains definitions for the Pet class and

IN JAVA PLEASE.

There are two main parts to this assignment.

1. Write a project and package that contains definitions for the Pet class and the Procedure class (see below for specifications).

2. Write a project and package that unit tests the Pet and Procedure classes. You will have to import the package that has the definitions of the Pet and Procedure classes.

Class screenshots are in order of : Procedure, Pet ,Main.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Additional Instructions:

- Create an automated test in main.

There should be unit tests of ALL get/set methods of both classes. GetJSON is NOT included here.

You need to write code that runs the other methods that are not being unit tested on each class (this includes GetJSON, constructors, Read, Write, toString etc).

The automated test should contain code that demonstrates that ALL methods work on both classes. DO NOT TAKE THE TESTING CODE LIGHTLY. IT IS VERY IMPORTANT TO SHOW THAT EVERYTHING ON EACH CLASS WORKS.

Hint: To truly test if the output produced by the Write method of either class works you need to try and read in the file that it class generates with its Read method. For example, assume you write data to a file named abc.txt using the write method. You should now use abc.txt file as input to the read method. If the program fails on this read there is an error.

Formats:

Pet File Format

PetName

PetSpecies

PetGender

Pet Sample Input File (Pet.txt)

Snickers

Dog

Male

Procedure File Format

ProcedureName

ProcedureCost

Procedure Sample Input File (Procedure.txt)

Rabies Shot

25.50

Member Variables (all private) Variable Data Type String double Description Name Name of the procedure Price Price of the procedure Member Method Signatures and Descirptions (all public) Signature Description Default Constructor Default constructor. Sets the values of each member variable to a default value Constructor that sets the values of the member variables. There should be a corresponding parameter for each member variable Constructor- I WO Parameters Get/set methods for all member variables void Write(PrintStream ps)Write the contents of all member variables to the given instance of PrintStream. Assume the PrintStream is already open and ready to use. Data should be written on to separate lines. DO NOT ADD ANY DESCRIPTIVE TEXT IN THE OUTPUT. JUST PRINT THE VALUES. IMPORTANT - Whatever data is written out should be readable by the Read method of this class. If descriptive text is added then Read will not work. void Read(Scanner s) Read the contents of all member variables from the given instance of Scanner. Assume the following: Scanner is already open Member variable values are on separate lines 1. 2. String GetJSON() This method should return a string using JSON formatting www.json.org). Here is the format: f variable name" : value,. Each variable name should be surrounded by quotes. If the variable data type is String then the value should be surrounded by double quotes. There should be a comma between each

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago

Question

What is loss of bone density and strength as ?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago