Page 1 of 1

that your hile has been received. Problem: Write a C# (Console) program that: Reads in the provided data file (city.txt)

Posted: Fri May 20, 2022 4:58 pm
by answerhappygod
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 1
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 1 (50.8 KiB) Viewed 72 times
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 2
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 2 (58.3 KiB) Viewed 72 times
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 3
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 3 (43.91 KiB) Viewed 72 times
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 4
That Your Hile Has Been Received Problem Write A C Console Program That Reads In The Provided Data File City Txt 4 (56.31 KiB) Viewed 72 times
that your hile has been received. Problem: Write a C# (Console) program that: Reads in the provided data file (city.txt) that contains the following data: ID, City, lat, Ing, country, iso2, iso3, capital, population The first row of the file contains the field names The list contains 42905 cities from the world. Create a 2-dimensional array Use Const for the row & column sizes that are used to create your 2D array. • Create a 2- dimensional array to handle the following file: a file containing 42906 rows (One header row and 42905 rows of data) each row has 9 data fields . Read the Data from the file and populate your 2-dimensional array with the data (NOTE: if you can't figure how to get the file into the array, create the array manually with a few rows of data (including the header), so you can at least continue with the rest of the program) The program can run as many times as the user wants (use WHILE LOOP) Stop the program when the user enters either "Q" or "Quit" to stop. (QUIT or Q) Quit program: (has to work for both Quit and Q) After quitting, display message thanking user for using program -

Valid choices are: (L/LIST) LIST ALL CITIES (C/CTRY) SEARCH BY COUNTRY (N/NAME) SEARCH BY CITY NAME (P/POPL) SEARCH BY POPULATION (S/STAT) STATISTICS (Q/QUIT) QUIT Depending on the user's choice, the program should perform the following tasks (use SWITCH): (LIST or L) LIST ALL CITIES: (has to work for both Land LIST) • List the Data, but only the following information: The first row displayed should be a Header row consisting of: ID (7) City (50) Country (41) ISO-2 [6] ISO-3 (6) Population (10) The number [n] next the column nar is the field size you need for formatting the output. Beware that the first row of the text file is a header row, not data The shape below is just an estimate, use the numbers provided O O o Ex: ID City Country ISO-2 ISO-3 Population 1 JP JPN Japan Indonesia Tokyo Jakarta Delhi ID 2 3 IDN 39105eee 35362000 31870000 India IN IND ... 42964 Timmiarmiut Greenland GL 10 GRL 42905 Nordvik Russia RU RUS <- 7 ->- 10 41 -> 50 ->-6--6-- . o (C/CTRY) SEARCH BY COUNTRY: (has to work for both C and CTRY) Return all cities for any given country. Ask the user for a country name (for example: Germany) If no cities were found for given country, display appropriate message, Else, list all cities which have the chosen country, in the country column. display city information as follows: ID (7) City (50) Country (41) ISO-2 (6) ISO-3 [6] Population (10) . . .

Ex: ID ISO-2 ISO-3 Population City Country DE DEU 3664088 211 Berlin DE DEU 407 Hamburg Munich Germany Germany Germany 1852478 1488202 DE DEU 483 ... 50 41 <7<- -><• 6-(-6-> 10 . . o o (N/NAME) SEARCH BY CITY NAME (has to work for both N and NAME) Return information for a given city. Ask user for a city name (for example: Los Angeles) If no city by that name found, display appropriate message, Else, provide the information given below for the chosen city. Display city information as follows: Each row is 68 characters wide (tab + 60 dashes) Every row starts with a ſtab) The detail rows have two (2) tabs followed by a label, The answers are right justified (lined up and aligned with the end of the dashes) The space covering the "[label]: (data)" is 52 characters With the tab, that should make 60 characters, [tab]City: [city) [tab]--- [tab. 60) [tab][tab]Country: [country) [tab][tab]150 2: [iso2] [tab][tab]ISO 3: (iso3] [tab][tab]ing/Lat: [ing / lat) [tabl- (tab + 60) [tab] 60 chars ..........→ Ex: Please enter a city name >> Los Angeles <tab><- 8 -><. - 52 - CITY: Los Angeles United States US Country: ISO 2: ISO 3: Lng/Lat: USA 34.1139 / -118.4068 <tab tab >--- --- 52 -

(P/POPL) SEARCH BY POPULATION: (has to work for both P and POPL) Return all cities within a population range between Low Limit and High Limit ONLY write a message about what it does. No need to complete . . [EXTRA CREDIT) EX1 o (S/STAT) STATISTICS (has to work for both S and STAT) Return the following statistics. Max population + City with maximum population Min population + City with minimum population Average population Display as bellow: [tab]Statistics [tab]- [tab + 60) [tab]Max Population: (max] (city) [tab]Min Population: [min] (city) [tab]AVG Population: (avg] [tab]- - [tab +60] [tab] 60 chars Ex: STATISTICS MAX Population: 39105800 MIN Population: 2 AVG Population: 107066 (Tokyo) (Mawlamyine) . O Don't forget to ask user for another entry: Display the appropriate error message and let the user know the valid choices are: (L/LIST) LIST ALL CITIES/(C/CTRY) SEARCH BY COUNTRY / (N/NAME) SEARCH BY CITY NAME/ (P/POPL) SEARCH BY POPULATION / (S/STAT) STATISTICS / (Q/QUIT) QUIT