Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i am looking for java. 1. Background Warehouse tem items items:ArrayListcltem> #name:string #weight: double +Item(name:String, a. Consider the class diagram shown on the right +Warehouse()

image text in transcribedimage text in transcribed

i am looking for java.

1. Background Warehouse tem items items:ArrayListcltem> #name:string #weight: double +Item(name:String, a. Consider the class diagram shown on the right +Warehouse() which shows that a ArrayList of items and Refrigerated!tems. +1 arehouse contains an Haddltem(item:ltem) getNumltems():int getRefrigeratedltems0) weight:double) +cost():double +getName):string +getWeight() double +toString():string) ArrayList getTotalCost():double b. An Item has a name and a weight which are +getTotalCost Refrigerated) double +toString):string supplied in the constructor. The cost method returns the cost of the item which is 2 times the weight. The tostring method should return a string like this: Refrigeratedltem #temp: double +Refrigeratedltem( name:string, weight:double temp:double) +Refrigeratedltem( item:ltem, temp:double) name Crackers, cost-$4.50, weight-2.25 A Refrigeratedltem also has a temperature which is supplied in the constructor. The cost ofa Refrigerateditem is 2 times the weight plus: (100 temp)*0.1. The toString method should return a string like this: c. +cost():double +getTemp():double +toString0:string name Ice Cream, cost-$10.00, weight-1.00, temp-20.00 degrees d. A Refrigerateditem has an additional constructor that converts an Item into a Refrigerateditem. Thus, the constructor accepts an Item and a temperature and uses the name and weight of the Item to initialize this Refrigerateditem

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

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

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago