Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Give Me This Answer As Soon As Possible And Please Give This Answer As Per The Question . Please Don't Give Me Wrong Answer

Please Give Me This Answer As Soon As Possible And Please Give This Answer As Per The Question . Please Don't Give Me Wrong Answer . Thank You So Much .

Q5;

Given the following template of abstract superclass named Mobile Phone and subclasses named IPhone and Android: public abstract class Mobile Phone { protected String serialNo; //serial number protected int capacity; //phone storage: //32, 64, 128, 256 or 512 protected int batteryLasting; Ileg 4000mAH protected String color; //phone color protected String datePurchased; //format dd/mm/yyyy //Methods: //constructors, accessor, printer public abstract double calPrice (); } public class IPhone extends Mobile Phone { private String type; //iphone11, iphone12 or iphone13 private String category; // standard, pro or pro max private boolean insurance; //true if taken the insurance //otherwise, false //Methods: //constructors, accessor, printer public double calPrice () {.... } // calculate total price } public class Android extends Mobile Phone { private String brand; //Asus, Lenovo o

ype; //iphone11, iphone12 or iphone13 private String category; // standard, pro or pro max private boolean insurance; //true if taken the insurance //otherwise, false //Methods: //constructors, accessor, printer public double calPrice () {.... } // calculate total price } public class Android extends Mobile Phone { private String brand; //Asus, Lenovo or Redmi private boolean dual Sim; //true if dual sim card //otherwise, false //Methods: //constructors, accessor, printer public double calPrice () {..... } // calculate total price } a) Write the following method definition: i) Accessor methods that return every attribute in superclass. (5 marks) ii) Processor method named calPrice () for both subclasses that calculate and return the total price of the phone that need to be paid by the buyer, based on the following informatio

The price for the standard iPhone type is given as follows: Type iphone11 iphone 12 iphone 13 Price (RM) 2100.00 3100.00 4100.00 For each category of iPhone bought, the customer needs to be paid either an extra of RM300 for pro or RM500 for pro max version. To those who are taken the insurance, he/she will be given a deduction of RM100 out of the total price. The price for the Android mobile phone is given as follows: Brand Asus Lenovo Redmi Price (RM) 1800,00 1500.00 2100.00 For the Android phone that has dual sim card, the extra price of RM50 need to be paid. (10 marks) b) Write code fragments in the application / driver class that can perform the following tasks: (Assume all relevant/basic methods have been defined in all classes involved) i) Declare an array of an object named phone to store various types of mobilePhone. (Can be any size of array) (1 mark) ii) Calculate and display the total price for every type of iPhone bought without insurance. (8 marks) iii) Count the number of all Asus mobile phones that were bought in December and display the related information about each object using the printer method.

Q6;

Q2 Questions Q2(A)-Q2(E) Are Based On Figure Q2 Tuah Enterprise Produces Parts For The Automobile Industry. The Executive Board Has Decided That The Firm's Product Catalog Shall Be Available On The Web Allowing Direct Electronic Ordering Via Web. An Important Large Customer Was Pushing The Idea. The Firm Has Accordingly Launched A Development Project. The

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Android Graphics

Authors: Wallace Jackson

1st Edition

1430257857, 978-1430257851

More Books

Students also viewed these Programming questions

Question

What are the three kinds of research types? Explain each type.

Answered: 1 week ago