Question: Write the program in C. The first picture is the details for the program. The second is the name, population, and area of each city
The following statistics for cities of the Vege country are stored in a file: Name: a string of characters less than 15 characters long. Population: an integer value. Area: square miles of type double Write a program that: -asks and gets the name of the input file from the user. Read the contents of the file into an array length 10 of structures ask the user for the name of a city (less than 15 characters long) and store it in the proper length string. Search the array of structures for a match and if found output the name of the city and its population density to the screen. A name match should ignore the case; ex: tomato" and "ToMAto" are a match. Ask the user for an output file name. Write the name of each city and its population density to the output file, on separate lines. Each output record has to be similar in format to input Submit the program file, input file, and output file in a zipped folder into the program 10 drop box. The file containing the statics is posted in the same module with the name "vegetables.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
