Phone
Phone class
- Code the Phone class according to the UML diagram. Test it with the class PhoneTester which is given and check that you get correct output.
+-------------------------------------------------------------------+
| ~ Phone |
+-------------------------------------------------------------------+
| -phoneNumber : String |
| -ownersName : String |
| -price : double |
+-------------------------------------------------------------------+
| +Phone() |
| +Phone(phoneNumber : String, ownersName : String, price : double) |
| +getPhoneNumber() : String |
| +getOwnersName() : String |
| +getPrice() : double |
| +setPhoneNumber(aNumber : String) |
| +setOwnersName(aOwnersName : String) |
| +setPrice(aPrice : double) |
+-------------------------------------------------------------------+
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
Console Output:
Details for samsung - defaults
123456
Tom
59.99
Details for iPhone
999
John
88.5
Updated details for iPhone
110
Tom
110.5