DPIT121 – Lab Exercise 1 Due: Week 2 lab The scenario for the lab is a simplified Mobile Provider Company and mobile plans. You will work on the same scenario throughout the session for most labs and...

1 answer below »
Hi this is my lab assignment of course object oriented and designing and this is assignment is too I important for me everything is mentioned in attached document just simple lab exercise few questions so kindly do this for me before deadline thanks


DPIT121 – Lab Exercise 1 Due: Week 2 lab The scenario for the lab is a simplified Mobile Provider Company and mobile plans. You will work on the same scenario throughout the session for most labs and all of your assignments. Study week 1 lecture codes in depth before attempting the lab: MobilePhone has these attributes: · String model; · MobileType type; // Type is an enum { Android, IOS, Windows} · int memorySize; · double price; There are two different types of Mobile Plans: Personal and Business plans. All Plans have the following attributes in common: · String userName; · int id; · MobilePhone handset; · int internetQuota; · int capLimit; PersonalPlan class has the following additional attributes: · String city; BusinessPlan class has the following additional attributes: · int numberOfEmployees ; · int ABN; The Personal Plan monthly payment is calculated as below: HandSetPrice/24 + capLimit/20 + internetQuota*5 + flatRate The Business Plan monthly payment is calculated as below: HandSetPrice/24 + capLimit/10 + internetQuota*10 + flatRate If the numberOfEmployees is more than 10 then add (numberOfEmployees -10)*50 to the monthly payment The flatRate will be set by the manager and will be sent to the calculation from outside as a parameter (currently from test code in main ). 1- Write the Java code to define the class MobilePhone as well as enum MobileType. (0.5 mark) 2- Write an abstract base class called Plan for the above scenario. This class supports the common features of all plans. (0.5 mark) 4- Write two sub classes called PersonalPlan and BusinessPlan for the scenario. (0.5 mark) 5- Write a print method for these classes. Use super.print ( ) in children classes. (0.5 mark) 5- Override the calcPayment method based on the description for Plan Monthly Payment. (0.5 mark) 6- Add toString() to all classes. (0.5 mark) 7- Write a test code that creates a mixture of PersonalPlan, and BusinessPlan objects, then places them in a single list of plans, print all the plans in the list by using print method and then by using toString method. Then calculates their total monthly payments and finally prints the total with user friendly prompts. Note that the flatRate should be stored as a constant in your test code and then is sent it to the methods as a parameter. (2 marks) 0.5 for list, 0.5 for print, 0.5 for toString, 0.5 for total payment
Answered Same DayMar 09, 2021

Answer To: DPIT121 – Lab Exercise 1 Due: Week 2 lab The scenario for the lab is a simplified Mobile Provider...

Vibhav answered on Mar 10 2021
136 Votes
AssignmentJava/1.JPG
AssignmentJava/BusinessPlan.java
AssignmentJava/BusinessPlan.java
public class BusinessPlan extends Plan{
    int numberOfEmploye
es;
    int ABN;

    public BusinessPlan(String userName, int id, MobilePhone handset, int internetQuota, int capLimit,
            int numberOfEmployees, int ABN) {
        super(userName, id, handset, internetQuota, capLimit);
        this.numberOfEmployees = numberOfEmployees;
        this.ABN = ABN;
    }
    @Override
    double calcPayment(int flatRate) {
        double price = 0;
        price += this.handset.price/24;
        price += this.capLimit/10;
        price += this.internetQuota*10;
        price += flatRate;

        if(this.numberOfEmployees > 10) {
            price += (this.numberOfEmployees-10)*50;
        }
        return price;
    }

    @Override
    public String toString() {
        String str = "";
        str += super.toString();
        str += numberOfEmployees + " : " + ABN + "\n";
        return str;
    }
    @Override
    public void print() {
    super.print();
    System.out.println(numberOfEmployees + " : " + ABN + "\n");
    }
}
AssignmentJava/MobilePhone.java
AssignmentJava/MobilePhone.java
public class MobilePhone {
    String model;
    enum MobileType {Android, IOS, Windows};
    MobileType type;
    int memorySize;
    double price;
    public MobilePhone(String model, int memorySize, double price, MobileType type) {
        super();
        this.model = model...
SOLUTION.PDF

Answer To This Question Is Available To Download

Submit New Assignment

Copy and Paste Your Assignment Here