Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Use of Java Collections (Not Required, 2 bonus marks) 6. You are encouraged to use collections such as ArrayList and HashMap. ArrayList implements an...

please help me to get the answer.I do not know where to start

  • Attachment 1
  • Attachment 2
  • Attachment 3
  • Attachment 4
  • Attachment 5
  • Attachment 6
Use of Java Collections (Not Required, 2 bonus marks)6. You are encouraged to use collections such as ArrayList and HashMap. ArrayList implementsan array which can grow indefinitely. HashMap allows an association to be created betweenkeys and objects. Using such classes also reduces the amount of code required as theyprovide methods for retrieving required objects easily.ArrayList<Comment> comments = new ArrayList<Comment> ();comments . add (comeComment ) ;To extract the 4th element:Comment c4 = comments. get); // index starts at 0You can use HashMap for storing objects, which have unique primary keys. For example,HashMap<String, Content> contents = new HashMap<String, Content>( );To add a content we use:contents. put ( new Game ( . . . ));To extract the content, use:content contentl = contents . get ("G101"); // return null if no such content is foundInput and outputYour program should hard code a list of objects including content objects, user objects andcomment objects etc. for testing purpose. See the skeleton sample code. (During marking, wemay replace these objects with our own to test your program).You program should have a simple menu to allow an admin to perform aforementioned taskssuch as:* upgrading a member to premium account;* purchasing one item for one user:* listing all available contents;* showing all purchased items of a user,*showing all comments of a content;Input validation and error handling should be implemented. Input and output should be inside ofthe class PlayStore Main.
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question