Question: SmartPhone data _ mega _ byte / / integer minutes / / type: double datacost / / accept double numbers voicecost / / accept double
SmartPhone
datamegabyteinteger minutes type: double datacost accept double numbers voicecost accept double numbers
All constructors
setters an getters as needed
add more methods if needed
toString
getBillo:double
tableDevicemodel namestringIMEI type: string number on any deviceprice accept double numbersmanufactureDate: String ddmmyyyy All constructors setters an getters as needed toString getBing
MobilePhone
smsnostring
packageno string
pricepackage accept double numbers
smscost accept float numbers
All constructors
setters an getters as needed add more methods if needed
tostringo
getBillo:double
Part A
Specify the relationship between classes.
Implement the different constructors for each class.
c The IMEI includes a mixture of letters and digits, with all letters capitalized.
When reading the IMEI from the user, you must check whether it meets the above requirements before acceptingsetting the value. Otherwise, you have to throw an exception new MyExceptionThe entered IMEI is not valid" where MyException is a custom evception you have to develop yourself.
Examples of invalid IMEI: ABX ABXCBz ABXFGJJKA, ABCABC. These IMEIs are not accepted because they may have a length of fewer than digits, they don't start with three characters, or they contain lowercase letters.
Examples of a valid IMEI: ABXCBZ
In the SmartPhone class, add the following methods:
getBill This method is responsible for returning the value of the bill using the following formula: datamegabytevoiceCost;
In the mobilePhone class, add the following methods:
getBill This method is responsible for returning the value of the bill using the following formula: smsnosmscostpricepackage;
Part C
Write a driver class called DriverYourStudentiD, for example, Driver This driver should test all methods. The driver must read data from a text file with the extension txt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
