
Java Programming
Using seriazation in java
Create a class named CellPhone implementing that has 4 data members - load, talkTime (min), ratePerMinute, ratePerText .
Define 3 constructors - one is the default constructor , second a constructor that would initialize all the attributes , and third is a constructor that allows the user to initialize all the attributes except the load, instead, directly set load to 300.
Also, define getter and setter methods for all attributes.Implement these methods :
(1) callCost that would return the total cost of the call based on the parameter 'duration'
(2) canCall method that returns true if parameter 'duration' (in min) is less than or equal to the available 'talkTime' and you have enough load to complete the call. [HINT: call callCost method and deduct the talkTime]
(3) isLowBat method that returns true if the talkTime is equal to zero
(4) canText method that reduces the load by its ratePerText and returns true if text is successfully sent and it consumes 0.05 minute of the talkTime and
(5) toString method that would print the remaining load balance
(6) To implement serialization, add writeObject and readObject methods
In a separate class TestCellphone, write a main method (refer to TestPerson class) that works the same as TestPerson class.

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

- Java Type the set up for a Class named Student with the following data fields, name, idNumber, gpa, address, and age. Include get and set methods for each data field.arrow_forwardObject-oriented programmingcreate a program that manages the production of a company. The production of each of the months of the year 2021 is saved, the average production of the year is also stored.Include a method to display all company information.Include at least three public or private type attributes. If they are private don't forget to include the getter and setter methods ONLY for private attributes.Include both default and parameterized constructors.Your program must allowShow all company dataRequest company dataShow the name of the month that had the highest production.Show the name of all the months with production less than the annual average.Identify the methods that are of the class and those that are of the main program.DO NOT forget that attributes, methods, classes, objects and messages are written in English.The MIN and MAX methods must be part of the main program. NOT of the classarrow_forwardThe language is Python Build a UML Diagram for the CellPhone class (The picture attatched below is what you need to reference when answering the question.)arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





