Lab 1b (Section E): the MobilePhone class
Create a MobilePhone class that stores load left (as a double) in pesos,
total minutes called (as an int),
and rate (as a double) in pesos per minute.
Load and minutes consumed start at 0,
rate starts at 6.50 pesos/minute.
Support the following methods:
- public void load( double pesos )
- public void call( int minutes )
- public double getLoadLeft()
- public int getTotalMinutesCalled()
optional:
- public void changeRate( double newCallRate )
- public void sendTextMessage(): subtract 1 peso from load
- public int getNumTextMessages(): you will need an extra field to support this
Write this program in BlueJ and test
the class by creating objects and running methods
on that object.
Also, write a MobileTester class that creates
two MobilePhone objects and executes all the methods that you have implemented.
You will be given more than 1 hour to complete this lab.
You are also expected to provide the proper documentation and comments
within your programs.
Zip your BlueJ project and submit through
moodle .