In this assignment, you will practice using Data Structures and Object Oriented concepts in Java. Your implementation should target the most efficient algorithms and data structures. You will be graded based on the efficiency of your implementation. You will not be awarded any points if you use simple nested loops to implement the below tasks.
You should use one or more of the below data structures:
- ArrayList :
- JavaDoc: http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html
- Tutorial: http://docs.oracle.com/javase/tutorial/collections/interfaces/list.html
You are provided with the Data class that contains a users array (Data.users) which is an array of users. Each element in the array represents a single user record. Each record is a string formatted as : firstname, lastname, age,email, gender, city, state. You are asked to perform the following tasks:
1. Your implementation for this question should be included in MainPart1.java file.
2. Create a User class that should parse all the parameters for each user. Hint: extract each value from a user's record using Java's String.split() method and set the delimiter to a comma. Each user record should be assigned to a User object.
3. Your goal is to Print out the TOP 10 oldest users.
4. Hint: To sort use the Collections.sort(). http://docs.oracle.com/javase/6/docs/api/java/util/Collections.html
This assignment has been answered 6 times in private sessions.
© 2022 Codify Tutor. All rights reserved