Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The telecommunication packages offered by the New Zealand mobile phone provider SparkPlug offer customers varying amounts of talk time, texts and data for different
The telecommunication packages offered by the New Zealand mobile phone provider SparkPlug offer customers varying amounts of talk time, texts and data for different prices. a) Create Java classes that model each of the following mobile packages. Remember, it is up to you to optimise your code re-use. The Standard package provides a mobile service keeping track of how many minutes the customer talks and the number of texts sent. o There are two functionalities for talking and texting, modelled by methods public void talk(int nMinsTalked) public void sendTexts(int nTextSent) These methods check if talk or text limits are reached. If so, the customer is notified via a message (printed to the console) whenever they try to talk or send texts. Limits are specified when a Standard object is created. Data mobile packages have the same functionality as Standard, but also have data usage (and limits). There are two kinds of Data packages: Heavy and Lite. Both of these packages offer data transfer functionality, modelled by the method public void transfer(int n) which checks data limits, notifying the customer when their limit is reached (hint: the transfer method should be in Data class as parent class and inherited by Heavy and Lite classes). b) Create methods to compute the cost of talking, texting and data, appropriate to the package. Standard package: Talk: 10C/min, text: 5/text Data Lite package: Talk: 100/min, text: 5/text, Data: 15/MB Data Heavy package: Talk: 10/min, text: free, Data: 25/MB c) Create the SparkPlugApp class with a main method that creates an array of mobile package objects and simulates the use of the various package functionality, calling the methods: sendText, talk and transfer. Example output: Please select a mobile phone package. 0: Talk: [0/10] Text: [0/100] 1: Talk: [0/20] Text: [0/56] Data: [0/1024] 2: Talk: [0/30] Text: [0/156] Data: [0/5120] 3: stop. 1 Talk: [0/20] Text: [0/56] Data: [0/1024] 1. Talk 2. Text 3. Data 4. Choose another plan Talk: [16/20] Text: [0/56] Data: [0/1024] Amount owing on account is: $1.60 1. Talk 2. Text 3. Data 4. Choose another plan Talk: [36/20] Text: [0/56] Data: [0/1024] Amount owing on account is: $3.60 1. Talk 2. Text 3. Data 4. Choose another plan 4 Talk: [36/20] Text: [0/56] Data: [0/1024] Amount owing on account is: $3.60 0: Talk: [0/10] Text: [0/100] 1: Talk: [36/20] Text: [0/56] Data: [0/1024] 2: Talk: [0/30] Text: [0/156] Data: [0/5120] 3: stop. 2 Talk: [0/30] Text: [0/156] Data: [0/5120] 1. Talk 2. Text 3. Data 4. Choose another plan Talk: [0/30] Text: [0/156] Data: [301/5120] Amount owing on account is: $75.25 1. Talk 2. Text 3. Data 4. Choose another plan 3 Talk: [0/30] Text: [0/156] Data: [648/5120] Amount owing on account is: $162.00 1. Talk 2. Text 3. Data 4. Choose another plan 4 Talk: [0/30] Text: [0/156] Data: [648/5120] Amount owing on account is: $162.00 0: Talk: [0/10] Text: [0/100] 1: Talk: [36/20] Text: [0/56] Data: [0/1024] 2: Talk: [0/30] Text: [0/156] Data: [648/5120] 3: stop.
Step by Step Solution
★★★★★
3.48 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
CodeStandardjava public class Standard protected int talktime protected int textcount ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started