fundamental requirements of programs

Anonymous
timer Asked: Jan 4th, 2019
account_balance_wallet $35

Question description

One of the fundamental requirements of programs is to use data stored in permanent storage such as a hard disk file. Programs must be able to read and write this type of data and use appropriate data structures within the program to work with the data. In this assignment, you will write a program to load and manipulate a data file. The data file can be downloaded from the following link: Unit 4 Sample Data.

The file should not be a comma delimited file and should have the following record structure:

  • FirstName – Character – Size (12)
  • LastName – Character – Size (16)
  • Company – Character – Size (32)
  • Address – Character – Size (32)
  • City – Character – Size (24)
  • County – Character – Size (24)
  • State – Character – Size (2)
  • ZIP – Number – Size (5)
  • Phone – Character – Size (12)
  • Fax – Character – Size (12)
  • Email – Character – Size (32)
  • Web – Character – Size (42)

Step 1: For this assignment, you will write a complete Java console program to load the data file into an ArrayList data structure. Store each line from the file as a separate record in the ArrayList. To read the file, you should use a FileReader wrapped in a BufferedReader. If you create a Java class to contain each record, you will be able to create an object for each record and store the object in the ArrayList. Sorting the data can then be done using another wrapper class that contains the ArrayList and has methods for sorting and output of the data.

Step 2: After the file is loaded into the ArrayList, sort the data in ascending order based on the LastName field, and display the following fields:

  • First name
  • Last name
  • Company

Step 3: Next, sort the data in descending order based on the ZIP field, and display the following fields:

  • First name
  • Last name
  • Company
  • ZIP

Step 4: Display all of the records (and all of the fields) for everyone that is in the state "NY."

Step 5: The submission should be a single MS Word document with the program source code for the solution and screenshots of the output for the following list:

  1. Sorted data based on last name
  2. Sorted data based on ZIP
  3. Everyone in the state of NY

Please submit your assignment.

FirstName Eddie Chris Brooklynn Zion Ruby Bob Susan Vicky Lee Mary Jennifer Michelle Conner Colin Sheila Rosy David Willa Tiana Douglas Colt Stephen Catherine Calvin LastName Company Address City County State Vazquez Osweep Industries 14316 Hancock Richdale Circle Anchorage AK Robinson Finch Products 2133 N West Deerford Street Maricopa AZ Taylor Prism Globe48 IncE 13th Blvd Corway HillsNew York NY Miller Switch Pen 196 Company State Ave LawnworthMiddlesex NJ Flynn Snap Sun Services 3175 W Carrier Meadowburg Lane Honolulu HI Lewis Code Planet22652 Properties E Easton East St Fortview Will Lake IL Hernandez Light Table Bearings 9630 S City Kingstown Ave Reservoir Maricopa AZ Perez Lime Cake Records 7421 Jefferson Hearthbridge Pkwy Lehigh PA Hill Round Rock884 Engineers W Glendale Old Lindenfield Rd Los AngelesCA Grove Edwards Simple Byte6122 Technologies E BlueUpper Vine Prkwy Caldbrook Orange FL Davis Quicker Span 2598 Reviews Oak RdEast Maymeadow Shelby TN Martin Diamond Post 329Surveys Brush Cir Belcove NW Marion OR Lee Cash Pad Loans 116 Rail Way Adamsfield Mahoning OH Brown Easy Rug Cleaners 1612 W BayBridgeing Rd Orange CA Garcia Clear Blue Window 152 Broad Cleaning Ln Portcroft Cove Bexar TX King Shots Manufacturing 6930 Bass Stream Old Clarksfax Blvd Hennepin MN Baker Box State Trading 6728 Timbuck Corporation Pittsfort St Mahoning OH Roberts Low Sky Seating 1519Company Hawk Coleford Ave El Paso TX Williams Country Boxes 24969 TibbsChristiansmount Circle Los AngelesCA Ingram Quicker Cupcakes 3450 Lion Rd BrunsbeachNueces TX Lopez Case Electronics 370 Stock Ave Fort Hansville Middlesex NJ Phillips Brown Technologies 1095 SW 2nd New Rd Hamford Vanderburgh IN Smith Side Sauce Spices 140 E 4th Street Hempline Island New York NY Morris Zippy Sandwiches 79 W Broadway Bayway Ave Franklin OH ZIP 99515 85004 10001 8861 96819 60410 85051 18087 91790 32809 38112 97302 44512 92802 78205 55428 44406 79925 91355 78408 8861 47713 10018 43215 Phone 907-456-8510 602-141-3716 212-778-6886 732-331-5270 808-947-7855 815-356-3760 602-842-3864 610-284-7632 626-849-7849 407-746-3200 901-438-6447 503-260-7108 330-869-4252 714-661-3939 210-340-4128 763-426-3083 330-644-7457 915-660-1619 661-368-4194 361-773-7322 732-553-9625 812-310-3693 212-830-5063 614-114-7890 Fax Email Web Convert to Pig Latin 907-456-2326 eddie@vazquez.com http://www.eddievazquez.com The Customer's Name is Eddie Vazquez and they work for Osweep Industries 602-141-2898 chris@robinson.com http://www.chrisrobinson.com The Customer's Name is Chris Robinson and they work for Finch Products 212-778-6875 brooklynn@taylor.com http://www.brooklynntaylor.com The Customer's Name is Brooklynn Taylor and they work for Prism Globe Inc 732-331-4107 zion@miller.com http://www.zionmiller.com The Customer's Name is Zion Miller and they work for Switch Pen Company 808-947-7119 ruby@flynn.com http://www.rubyflynn.com The Customer's Name is Ruby Flynn and they work for Snap Sun Services 815-356-1330 bob@lewis.com http://www.boblewis.com The Customer's Name is Bob Lewis and they work for Code Planet Properties 602-842-4662 susan@hernandez.com http://www.susanhernandez.com The Customer's Name is Susan Hernandez and they work for Light Table Bearings 610-284-5884 vicky@perez.com http://www.vickyperez.com The Customer's Name is Vicky Perez and they work for Lime Cake Records 626-849-2614 lee@hill.com http://www.leehill.com The Customer's Name is Lee Hill and they work for Round Rock Engineers 407-746-1395 mary@edwards.com http://www.maryedwards.com The Customer's Name is Mary Edwards and they work for Simple Byte Technologies 901-438-4022 jennifer@davis.com http://www.jenniferdavis.com The Customer's Name is Jennifer Davis and they work for Quicker Span Reviews 503-260-7000 michelle@martin.com http://www.michellemartin.com The Customer's Name is Michelle Martin and they work for Diamond Post Surveys 330-869-4647 conner@lee.com http://www.connerlee.com The Customer's Name is Conner Lee and they work for Cash Pad Loans 714-661-2748 colin@brown.com http://www.colinbrown.com The Customer's Name is Colin Brown and they work for Easy Rug Cleaners 210-340-1086 sheila@garcia.com http://www.sheilagarcia.com The Customer's Name is Sheila Garcia and they work for Clear Blue Window Cleaning 763-426-2774 rosy@king.com http://www.rosyking.com The Customer's Name is Rosy King and they work for Shots Manufacturing 330-644-9322 david@baker.com http://www.davidbaker.com The Customer's Name is David Baker and they work for Box State Trading Corporation 915-660-4618 willa@roberts.com http://www.willaroberts.com The Customer's Name is Willa Roberts and they work for Low Sky Seating Company 661-368-1035 tiana@williams.com http://www.tianawilliams.com The Customer's Name is Tiana Williams and they work for Country Boxes 361-773-2874 douglas@ingram.com http://www.douglasingram.com The Customer's Name is Douglas Ingram and they work for Quicker Cupcakes 732-553-2886 colt@lopez.com http://www.coltlopez.com The Customer's Name is Colt Lopez and they work for Case Electronics 812-310-6514 stephen@phillips.com http://www.stephenphillips.com The Customer's Name is Stephen Phillips and they work for Brown Technologies 212-830-8652 catherine@smith.com http://www.catherinesmith.com The Customer's Name is Catherine Smith and they work for Side Sauce Spices 614-114-5010 calvin@morris.com http://www.calvinmorris.com The Customer's Name is Calvin Morris and they work for Zippy Sandwiches for Light Table Bearings r Simple Byte Technologies or Diamond Post Surveys Clear Blue Window Cleaning ox State Trading Corporation Low Sky Seating Company

Tutor Answer

criss53
School: Boston College

Check it please.

Main Program
import
import
import
import

java.io.BufferedReader;
java.io.FileReader;
java.util.ArrayList;
java.util.*;

public class Driver {
/**
* Utility function to print
*/
static void print(String string) {
System.out.print(string);
}

public static void main(String[] args) {
ArrayList records = new ArrayList();
String line;
try {
FileReader fileReader = new
FileReader("itco321_u4ip_sample_data.csv"); //2
BufferedReader bufferedReader = new BufferedReader(fileReader); //3
line = bufferedReader.readLine();
while ((line = bufferedReader.readLine()) != null) {
String[] data = line.split(",");
Record record = new Record();
record.setFirstName(data[0]);
record.setLastName(data[1]);
record.setCompany(data[2]);
record.setAddress(data[3]);
record.setCity(data[4]);
record.setCounty(data[5]);...

flag Report DMCA
Review

Anonymous
10/10 would recommend. Responsive and helpful.

Similar Questions
Hot Questions
Related Tags

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors