Question: 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

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:
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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!