Question: 2. Write code for a SmartPhone class which is an InternetThing that includes: a. A constructor which accepts a manufacturer(string), a model(String), a serial

2. Write code for a SmartPhone class which is an InternetThing that includes: a. A constructor which accepts a manufacturer(string), a model(String), a serial number(String) and the number of associated megapixels(int) as its parameters. This constructor shall store the each argument appropriately and will set the phone's status to "locked". After assigning all instance data, the constructor should print the value "Created "+ the result of the toString method. b. A method named setPassword that accepts two strings (old password and new password) as its parameters. The method shall change the password to the new password value only if the old password given as a parameter matches the password stored on the phone, and if the phone is unlocked. If the password is successfully changed, the method will print the value "Successfully changed password for "+ the result of the toString method c. A method named lock that will lock the phone(), and print the value "Locked "+ the result of the toString method. d. A method named isLocked that returns the value true if the phone is locked.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
