Skip to content
← Back to Community
Help with displaying the city from user inputed zip code
Profile icon
KarterBeaver

Hello, I have an assignment due in two days for input files. So heres the problem.. you need to display the county with zipcode and have the user input the zip code to get the county. But when you put in the zip it re displays everything instead of just the county.

The other question is you have a list of people in your class and you need to display how many freshman, sophmore, juniors, and seniors...

Code to search a zip and it will display the county:

  1. Prompt the user for a zip code to search for.

  2. Find the matching county.
    • If you used variables, loop through all the
    data again and only output the county with
    the target zip code.
    • If you used arrays, you will search the zip
    code array and output the parallel county
    array.
    Example:
    Enter in a zip: 46143
    County: Johnson
    Another run in the program:
    Enter in a zip: 46901
    County: Howard

  3. Count and display how many of each grade there
    are.

  4. Display the total count at the end of the program
    (outside of the loop)
    Example:
    In my class there are:
    2 Freshmen
    3 Sophomores
    5 Juniors
    4 Seniors
    Total Number of students is: 14

Voters
Profile icon
CalebDitchley
Profile icon
KarterBeaver
Comments
hotnewtop
Profile icon
KarterBeaver

464D69F3-F6B1-42EE-807A-66DB65E99FDC