The telecommunication packages offered by the New Zealand mobile phone provider SparkPlug offer customers varying amounts...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
CodeStandardjava public class Standard protected int talktime protected int textcount ... View the full answer
Related Book For
Principles of Corporate Finance
ISBN: 978-0077404895
10th Edition
Authors: Richard A. Brealey, Stewart C. Myers, Franklin Allen
Posted Date:
Students also viewed these accounting questions
-
A mobile phone service provider randomly samples customers each year to measure current satisfaction with the service provided. The following table summarizes a portion of the survey, with 100...
-
Try to remember how you reached the decision. Did you sit down and consciously think through the implications of each alternative, or did you make a decision on the basis of intuition? Did you use...
-
How often should a telecommunication firm offering cellular phone service update its database? Why?
-
Which of these statements is false? A. Assets = Liabilities + Equity B. Assets Liabilities = Equity C. Liabilities Equity = Assets D. Liabilities = Assets Equity
-
a. How should John handle the situation? b. Should he confront Margarat with his concerns? c. Should John go to the police? d. Assume that this year is the first year that John is the auditor of...
-
If the coefficient of static friction at C is s = 0.3, determine the largest force F that can be applied to the 5-kg ring without causing it to slip. Neglect the thickness of the ring. G 0.4 m C 30...
-
A \(45^{\circ}\) off-axis specimen cut from an AS/3501 carbon/epoxy lamina is subjected to a tensile test. The specimen is \(3 \mathrm{~mm}\) thick and \(25 \mathrm{~mm}\) wide, and a tensile load of...
-
Non constant Dividends North Side Corporation is expected to pay the following dividends over the next four years: $8, $7, $5, and $2. Afterward, the company pledges to maintain a constant 5 percent...
-
Define the various forms of employee empowerment and analyse the benefits of empowered employees in the service sector. Question 2 Identify the key components of the servicescape and critically...
-
Margo, a calendar year taxpayer, paid $1,580,000 for new machinery (seven-year recovery property) placed in service on August 1, 2023. a. Assuming that the machinery was the only tangible property...
-
Perform the multiplication of -15 and 6 using Booths algorithm. Perform 15/6 using (a) restoring (b) non-restoring algorithm.
-
Briefly differentiate linear search algorithm from a binary search algorithm.
-
Write a note on the advantages and disadvantages of the BFS algorithm.
-
What is the difference between a directed graph and a non-directed graph?
-
Write and explain a C program to implement a linear search algorithm?
-
Explain different ways of deleting of nodes in the BST.
-
Suppose that the present value of lifetime earnings is $20 million. Assume that interest rate (i) is 5% and the growth rate for 1 year of college is 10% for a certain player. a) If the player goes to...
-
Suppose you are comparing just two means. Among the possible statistics you could use is the difference in means, the MAD, or the max min (the difference between the largest mean and the smallest...
-
In October 2008, six-month (182-day) Treasury bills were issued at a discount of 1.4%. What is the annual yield?
-
Look again at the balance sheet for Geomorph in Problem 10. Suppose that at year-end Geomorph had $30 in cash and marketable securities. Immediately after the year-end it used a line of credit to...
-
Find the live spreadsheet for Table on this books Web site, www.mhhe.com/bma. Show how duration and volatility change if (a) The bonds coupon is 8% of face value and (b) The bonds yield is 6%....
-
How do you classify a lathe? Explain briefly.
-
Differentiate between live and dead centres of a lathe.
-
List the various lathe accessories.
Study smarter with the SolutionInn App