Welcome to AssignmentCache!

PRG/421 Week 4 Java 4.6 LAB: Zip code and population (generic types)

Availability: In stock

$7.00

Quick Overview

PRG/421 Week 4 Java 4.6 LAB: Zip code and population (generic types)


Define a class StatePair with two generic types (Type1 and type2), a constructor mutators, accessors, and a printinfo() method. Three ArrayLists have been pre-filled with StatePair data in main():
• ArrayList<StatePairInteger, String>> zipCodeState: Contains ZIP code/state abbreviation pairs
• ArrayList<StatePair<string, String>> abbrevstate: Contains state abbreviation/state name pairs
• ArrayList<StatePair<string. Integer>> state Population Contains state name/population pairs


Complete main() to use an input ZIP code to retrieve the correct state abbreviation from the ArrayList ZipCodeState. Then use the state abbreviation to retrieve the state name from the ArrayList abbrevState. Lastly, use the state name to retrieve the correct state name/population pair from the ArrayList state Population and output the pair.


Ex If the input is:
21044


the output is:
Maryland: 6079602

PRG421 Week 4 Java 4.6 LAB Zip code and population (generic types)

Double click on above image to view full picture

Zoom Out
Zoom In

More Views

  • PRG421 Week 4 Java 4.6 LAB Zip code and population (generic types)
  • PRG421 Week 4 Lab 4.6 Zip code and population (generic types) StatePair
$7.00

Details

PRG/421 Week 4 Java 4.6 LAB: Zip code and population (generic types)

Define a class StatePair with two generic types (Type1 and type2), a constructor mutators, accessors, and a printinfo() method. Three ArrayLists have been pre-filled with StatePair data in main():
• ArrayList<StatePairInteger, String>> zipCodeState: Contains ZIP code/state abbreviation pairs
• ArrayList<StatePair<string, String>> abbrevstate: Contains state abbreviation/state name pairs
• ArrayList<StatePair<string. Integer>> state Population Contains state name/population pairs

Complete main() to use an input ZIP code to retrieve the correct state abbreviation from the ArrayList ZipCodeState. Then use the state abbreviation to retrieve the state name from the ArrayList abbrevState. Lastly, use the state name to retrieve the correct state name/population pair from the ArrayList state Population and output the pair.

Ex If the input is:
21044

the output is:
Maryland: 6079602

Additional Information

Special Price $3.00

Product Tags

Use spaces to separate tags. Use single quotes (') for phrases.

[profiler]
Memory usage: real: 18087936, emalloc: 17868024
Code ProfilerTimeCntEmallocRealMem