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 HashSet :
- JavaDoc: http://docs.oracle.com/javase/7/docs/api/java/util/HashSet.html Tutorial: http://docs.oracle.com/javase/tutorial/collections/interfaces/set.html HashMap :
- JavaDoc: http://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html
- Tutorial: http://docs.oracle.com/javase/tutorial/collections/interfaces/map.html
Question 1
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:
- Your implementation for this question should be included in MainPart1.java file.
- Create a User class that should parse all the parameters for each user. Hint: extract each value from a users record using Javas String.split() method and set the delimiter to a comma, see provided code below. Each user record should to be assigned to a User object.
- Your goal is to Print out the TOP 10 oldest users.
- Hint: To sort use the Collections.sort(). http://docs.oracle.com/javase/6/docs/api/java/util/ html
Question 2
Using the same Data.users array. You are asked to perform the following tasks:
- Your implementation for this question should be included in MainPart2.java file.
- The goal is to count the number of users living each state. Print out the list of State, Count order in ascending order by count.
Question 3
This is a simple programming question that focuses on finding the longest increasing subarray. Given the array A = {1,2,3,2,5,2,4,6,7} the longest increasing subarray is {2,4,6,7}, note that the values have to be contiguous. You are asked to perform the following tasks:
- Your implementation for this question should be included in MainPart3.java file. Implement the printLongestSequence method. You are provided with example inputs and outputs in the provided Java project.
Question 4
In this question you will use the Data.users and Data.otherUsers arrays that include a list of users. You are asked to perform the following tasks:
- Your implementation for this question should be included in MainPart4Bonus.java.
- The goal is to print out the users that are exist in both the Data.users and Data.otherUsers. Two users are equal if all their attributes are equal.
- Print out the list of users which exist in both Data.users and Data.otherUsers. The printed list of users should be sorted by state in descending order.

![[Solved] ITIS/CS 5180 Assignment1-OOP Concepts](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] ITIS/CS 5180 Assignment13-MessageMe wuth Firebase](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.