Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

25 20 Colorier Sarfnas-Workspace Jave Problemsetpt.Java Problemata.Java1313 Error Cannot Find Symbol Carte Value Between The Text The Rate Int Renumber Raunbergen.NextInt (Rangel) Sini; System.Out.Println(Tes Variable

25 20 Colorier Sarfnas-Workspace Jave Problemsetpt.Java Problemata.Java1313 Error Cannot Find Symbol Carte Value Between The Text The Rate Int Renumber Raunbergen.NextInt (Rangel) Sini; System.Out.Println(Tes Variable Rauber.Com Location Class Problemsetta T51 Errer Costolimer-Sabrina:-/Workspaces 28 29 30 21 System.Out.Println("Generating Random Vate

i need this error fix please help. Code is in java

Q40;

QUESTION 2 (30 MARKS) 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: 1/32, 64, 128, 256 or 512 protected int batteryLasting; //eg 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 MobilePhone { private String type; //iphoneli, iphone12 or iphone13 private String category; //standard, pro or pro max private boolean insurance; //true if taken the insurance 1/otherwise, false //Methods: //constructors, accessor, printer public double calPrice () {...} //calculate total price } public class Android extends Mobile Phone { private String bra

a) Write the following method definition: i) Accessor methods that return every attribute in superclass. (5 market 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 information:

b) Write code fragments in the application / driver class that can perform the following tasks: (Assume all relevant 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. (6 marks)

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