Lab 2: 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:
- void load( double pesos )
- void call( int minutes )
- double getLoadLeft()
- int getTotalMinutesCalled()
- void changeRate( double newCallRate )
- void sendTextMessage(): subtract 1 peso from load
Use if statements to ensure that:
- calls that cost more than your load are forbidden
optional: allow the call but only up to what the remaining load
could handle
- for the load method: the amount to be loaded
should be at least 100 pesos
- the call rate should not exceed 10 pesos/minute
- sending a text message is forbidden if you have less than
5 pesos load left remaining
Write this program in BlueJ and test
the class by creating objects and running methods
on that object.
Zip your BlueJ project and submit through
moodle .
Make sure you have your name and a class description written in your class
and your zip file is named Lab2xxxxxx.zip, where xxxxxx is your id number.