Question: in java code Create a class CellPhone that keeps track of cellphones unique identifiers. The class has the following attributes: Variables tag a static integer

in java code Create a class CellPhone that keeps track of cellphones unique identifiers. The class has the following attributes: Variables tag a static integer that begins at 1 and changes each time an instance is created imei a string that is unique for each instance of this class Brand - Brand of the phone Model - Which model device it is Create a constructor that sets the name to IMEI concatenated with the value of tag. After setting the name, this constructor changes the value of tag by calling the method changeTag. This ensures that every device gets a unique IMEI value to identify it based on the tag. This will also set the brand and model of the phone it has the following methods: Setters for brand and model Getters for all variables writeOutput to print information for a device isPrime(n) a private static method that returns true if n is prime. To check if it is prime, check if it is divisible by any numbers between 2 and n-1. changeTag - a private static method that replaces tag with the next prime number larger than the value of tag. (You can use a loop that utilizes isPrime to find the next prime number) Create a driver program. In this you will create 5 phones. Create an array for these devices and save the phones into the array Using a foreach loop, call the writeoutput method for each device.

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 Databases Questions!