Lab Task – 5
UML to JAVA Code
Solve Any One (other one is Home work)
1. Convert the above UML into Java Code.
➢ Store details of Mobiles.
➢ Display all the Mobile List.
➢ Search for a friend by their Name/Code/Brand.
➢ You can edit or delete any their information.
Mobile
MyClass
-name: String
has
-code: int
+main(String) : void
-price: double
-brand: String
+insertRecord (String , int, double, String) : void
+displayRecord():void
+searchRecord(String, code, brand) : void
+deleteRecord(int): void
2. Suppose you are going to design a PhoneBook to store contact details of
your friends.
You can -
➢ Store Name, Phone Number and Email Address of your Friends.
➢ Display all the Friend List.
➢ Search for a friend by their Name/Phone/Email.
➢ You can edit or delete any their information.
PhoneBook
-name: String
-phone: String MyClass
-email: String
has
+main(String) : void
+setName(String):void
+setPhone(String) : void
+setEmail(String) : void
+getName() : String
+getPhone() : String
+getEmail() : String