Question: You are designing a program that will keep track of the boxes in a doctor's office. Each box will have three attributes: date, contents, and

  1. You are designing a program that will keep track of the boxes in a doctor's office. Each box will have three attributes: date, contents, and location. Write a class that will consist of box objects.

Public class Box

{

private String myDate;

private String myContents;

private String myLocation;

public class Box(String date, String contents, String location)

{

myDate = date;

myContents = contents;

myLocation = location;

  1. Continuing with the program in problem #1, create instances of the class for these boxes:
    Box #23 contains medical records from 2016 and is in the storage closet.
    Box #21 contains lotion samples manufactured in 2018 and is in the waiting room.
    Box #07 contains flyers about the flu shot for 2020 and is in the receptionist's desk.

private String 2016;

private String medical records;

private String storage closer; 

public class Box(2016, medical records, storage closet) 

myDate = 2016;

myContents = medical records; 

myLocation = storage closet; 

}

  1. Continuing with the program in problem #2, write statements that will print out the date of box #23, the contents of box #07, and the location of box #21.

private String 2016; 

private String medical records; 

private String storage closer; 

public class Box(2016, medical records, storage closet) 

myDate = 2016; 

myContents = medical records; 

myLocation = storage closet; 

}

  1. Continuing with the program in problem #3, write a method that could be used to tell if the attributes of two boxes are identical.

 

  1. Continuing with the program in problem #4: Box #10 has identical attributes to Box #07. Create box #10. Then, write two statements that will print out: one will compare the contents of Box #07 and Box #10, and the other will compare the contents of Box #21 and Box #23.

 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!