Question: write a java program . . Design a class representing a mobile phone. Make sure the class contains the following: An attribute representing the mobile
write a java program 
. . Design a class representing a mobile phone. Make sure the class contains the following: An attribute representing the mobile phone's International Mobile Equipment Identity number (format: 15 decimal digits for our purposes). Make this a of type String. An attribute representing whether the mobile phone is on/off. Make this of type boolean. A constructor taking a String IMEI number. An operation to make a call. This should take a String parameter indicating the number to call. This method has some logic and three cases to handle: o If the phone is not powered on, just print a message indicating that condition. If the phone is powered on and the number is the special number "*#06#", then print the IMEI number. Otherwise, print a message indicating that a call is initiated to the "number to call". See test data below for message examples. An operation to power on the phone. This should turn the mobile phone on. Getters where appropriate. . Add a test class (with a main()) and create the following test mobile phones, turn them on (use your method operation) and make a call (use your method operation) from each. Test data for this project is (in order): Phone Number to Call 8675309 Test Phone IMEI 358844102814380 352233097803515 352233097803515 2024561414 2024561414 Result Message to console: "Call initiated to 8675309" Message to console: "Phone is not powered on" Message to console: "Call initiated to 2024561414"| Message to console: "IMEI number: 352233097803515 352233097803515 *#06# Important points: Phones are created in a "powered off" state. Your Mobile Phone class should NOT have a main() method. Your Test Class WILL have a main() and will create two mobile phone instances as seen by the IMEI numbers above. My sample execution output: Call initiated to 8675309 Phone is not powered on Call initiated to 2024561414 IMEI number: 352233097803515
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
