Question: Develop a class named DemographicsAnalysis.java that uses the file adultdata.csv to complete the following tasks. Note that the fields of the adultdata.csv file are (in
Develop a class named DemographicsAnalysis.java that uses the file adultdata.csv to complete the following tasks. Note that the fields of the adultdata.csv file are (in this order): age, workclass, education, marital status, occupation, race, sex, average number of hours worked per week, native country and salary.
a. Create a Table named allData that contains all information in adultdata.csv.
b. There are rows in allData that have missing values. These missing values are indicated by a question mark. Create a Table called cleanData that contains only rows from allData that have no missing data. To help, note that that neither the age or average number of hours worked per week columnns have missing records. It is possible that any of the other fields might have missing values. Print out the number of rows and columns of cleanData after youve populated it.
c. Create a Table named ageTable that displays all females over the age of 40 in cleanData that graduated with more than a high school degree. Sort the Table by age in descending order. Give your Table an appropriate name. Display your Table to the console (i.e. print to screen).
d. Create and display a cross-tabulation showing the proportion of the people in cleanData by race and gender. e. Create a Table named workByOccupation that displays the mean of the average hours worked for each occupation based on the data in the cleanData (yes, we are taking an average of an average). Sort the Table in ascending order by average hours worked per week. Give your Table an appropriate name. Display the Table to the console.
I have a csv file named 'adultdata' that is to be used to answer the above question. Unfortunately, it is too large to upload here. This code is to be written in Java using IntelliJ. If you have any questions please let me know :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
