Professional Documents
Culture Documents
Experiment1.2
Aim/Overviewofthepractical:
The goal of this project is to design and implement a simple inventory control system
for a small video rental store. Define least two classes: a class Video to model a video
and a class Video Store to model the actual store.
Tasktobedone/Whichlogisticsused:
AssumethatanobjectofclassVideohasthefollowingattributes:
1.A title;
2. aflagtosaywhetheritischeckedoutornot;and3.Anaverageuserrating.
AddinstancevariablesforeachoftheseattributestotheVideoclass.
Inaddition,youwillneedtoaddmethodscorrespondingtothefollowing:
1.beingcheckedout;
2. beingreturned;and 3.receivingarating.
The Video Store class will contain at least an instance variable that references an array
ofvideos(sayoflength10).TheVideoStorewillcontainthefollowingmethods:
1.addVideo(String):addanewvideo(bytitle)totheinventory;
2. checkOut(String):checkoutavideo(bytitle);
3. returnVideo(String): return avideo to thestore;
4. receiveRating(String, int) : take a user's rating for a video; and 5. listInventory(): list
the whole inventory of videos in the store.
Finally, create a Video Store Launcher class with a main() method which will test the
functionality of your other two classes. It should allow the following.
1.Add3videos:"TheMatrix","GodfatherII","StarWarsEpisodeIV:ANewHope".
2. Giveseveralratingstoeachvideo.
3. Renteachvideooutonceandreturnit.
System.out.println("Wornginput!");
}
}
}
box.listInventory();
}
}
Result/Output/WritingSummary: