b) Given the following Clock and ArrayList ADTS: public class Clock { } private String brand; // private String shape; /

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

b) Given the following Clock and ArrayList ADTS: public class Clock { } private String brand; // private String shape; /

Post by answerhappygod »

B Given The Following Clock And Arraylist Adts Public Class Clock Private String Brand Private String Shape 1
B Given The Following Clock And Arraylist Adts Public Class Clock Private String Brand Private String Shape 1 (72.31 KiB) Viewed 35 times
b) Given the following Clock and ArrayList ADTS: public class Clock { } private String brand; // private String shape; //round, square private double price; //normal constructor //Accessor methods:getShape (), getPrice (), getDesign (), getType() //printer method: toString() private String design; //antique, modern private char type; //D: digital, A: analog public class ArrayList { public ArrayList() {...} public void add (Clock data) {...} public int size () {...} public clock get (int index) {...} } //definition of other methods Assume that 15 objects of Clock have been inserted into an array list named clockAL. Write program fragment for each of the following: i) Count and display the number of digital round shape clock in clockAL (3.5 marks) ii) Calculate and display the total price of analog clock in clockAL which price is more than RM150 (3.5 marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply