Design the CellPhone class so that the main method of tester class can produce the…
- User
Design the CellPhone class so that the main method of tester class can produce the following output:
Tester Class public class Tester9{ public static void main(String[]args){ CellPhone phone1 = new CellPhone(); phone1.printDetails(); phone1.model ="Nokia 1100"; System.out.println("1##################"); phone1.storeContact("Joy - 01834"); phone1.printDetails(); System.out.println("2##################"); phone1.storeContact("Toya - 01334"); phone1.storeContact("Aayan - 01135"); phone1.printDetails(); System.out.println("3##################"); phone1.storeContact("Sani - 01441"); phone1.printDetails();
} }Output Phone Model unknown Contacts Stored 0 1################## Contact Stored Phone Model Nokia 1100 Contacts Stored 1 Stored Contacts: Joy - 01834 2################## Contact Stored Contact Stored Phone Model Nokia 1100 Contacts Stored 3 Stored Contacts: Joy - 01834 Toya - 01334 Aayan - 01135 3################## Memory full. New contact can't be stored. Phone Model Nokia 1100 Contacts Stored 3 Stored Contacts: Joy - 01834 Toya - 01334 Aayan - 01135
- Assistant
To design the
CellPhoneclass so that it produces the desired output with the given tester class, we need to consider the following functionalities:- The
CellPhoneclass should have a model attribute.
- The
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.