write a c program to - (a)(i) Create an City structure that will have the following members: name (string type), population (int type), area (float type) and numOfCOVIDPatients (int type). (ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will have a lower case n to keep track of the number of cities in the array. You will pass this array and # of cities  as arguments to the functions. (b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and n as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference? (c) Create a function “searchACity” that takes a City structure array, # of COVID patients, and n as parameters. It finds and displays the city’s information from the array searching by the # of COVID patients. (d) Create a function “displayAllCitiesInfoReverse” that takes a City structure array and the size of the array as parameters. It displays all Cities’ information in reverse index order in a tabular format with following values (including the given column heading): City Name – City Population – City Area – Num of City COVID Patients ======= BD Covid Case Tracking System ========= • Enter ‘r, to take information of all the cities into the City structure array of size N. • Enter ‘s’, to search a City by # of COVID patients. If found, display the info of City. If not, display “Not Found”. • Enter ‘t’, to display the information of all the Cities in reverse index order in a tabular format. • Enter ‘q’, quit/exit the menu system. • For any other input, display “Invalid Input” After the menu is displayed, the program will prompt the user “Enter your choice: “ to enter a choice from the menu. After user enters his choice, using switch case the program will call appropriate functions to do the task.
write a c program to - (a)(i) Create an City structure that will have the following members: name (string type), population (int type), area (float type) and numOfCOVIDPatients (int type). (ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will have a lower case n to keep track of the number of cities in the array. You will pass this array and # of cities  as arguments to the functions. (b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and n as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference? (c) Create a function “searchACity” that takes a City structure array, # of COVID patients, and n as parameters. It finds and displays the city’s information from the array searching by the # of COVID patients. (d) Create a function “displayAllCitiesInfoReverse” that takes a City structure array and the size of the array as parameters. It displays all Cities’ information in reverse index order in a tabular format with following values (including the given column heading): City Name – City Population – City Area – Num of City COVID Patients ======= BD Covid Case Tracking System ========= • Enter ‘r, to take information of all the cities into the City structure array of size N. • Enter ‘s’, to search a City by # of COVID patients. If found, display the info of City. If not, display “Not Found”. • Enter ‘t’, to display the information of all the Cities in reverse index order in a tabular format. • Enter ‘q’, quit/exit the menu system. • For any other input, display “Invalid Input” After the menu is displayed, the program will prompt the user “Enter your choice: “ to enter a choice from the menu. After user enters his choice, using switch case the program will call appropriate functions to do the task.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
write a c program to -
(a)(i) Create an City structure that will have the following members: name (string type), population (int type), area (float type) and numOfCOVIDPatients (int type).
(ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will have a lower case n to keep track of the number of cities in the array. You will pass this array and # of cities  as arguments to the functions.
(b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and n as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference?
(c) Create a function “searchACity” that takes a City structure array, # of COVID patients, and n as parameters. It finds and displays the city’s information from the array searching by the # of COVID patients.
(d) Create a function “displayAllCitiesInfoReverse” that takes a City structure array and the size of the array as parameters. It displays all Cities’ information in reverse index order in a tabular format with following values (including the given column heading):
City Name – City Population – City Area – Num of City COVID Patients
======= BD Covid Case Tracking System =========
• Enter ‘r, to take information of all the cities into the City structure array of size N.
• Enter ‘s’, to search a City by # of COVID patients. If found, display the info of City. If not, display “Not Found”.
• Enter ‘t’, to display the information of all the Cities in reverse index order in a tabular format.
• Enter ‘q’, quit/exit the menu system.
• For any other input, display “Invalid Input”
After the menu is displayed, the program will prompt the user “Enter your choice: “ to enter a choice from the menu. After user enters his choice, using switch case the program will call appropriate functions to do the task.
(a)(i) Create an City structure that will have the following members: name (string type), population (int type), area (float type) and numOfCOVIDPatients (int type).
(ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will have a lower case n to keep track of the number of cities in the array. You will pass this array and # of cities  as arguments to the functions.
(b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and n as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference?
(c) Create a function “searchACity” that takes a City structure array, # of COVID patients, and n as parameters. It finds and displays the city’s information from the array searching by the # of COVID patients.
(d) Create a function “displayAllCitiesInfoReverse” that takes a City structure array and the size of the array as parameters. It displays all Cities’ information in reverse index order in a tabular format with following values (including the given column heading):
City Name – City Population – City Area – Num of City COVID Patients
======= BD Covid Case Tracking System =========
• Enter ‘r, to take information of all the cities into the City structure array of size N.
• Enter ‘s’, to search a City by # of COVID patients. If found, display the info of City. If not, display “Not Found”.
• Enter ‘t’, to display the information of all the Cities in reverse index order in a tabular format.
• Enter ‘q’, quit/exit the menu system.
• For any other input, display “Invalid Input”
After the menu is displayed, the program will prompt the user “Enter your choice: “ to enter a choice from the menu. After user enters his choice, using switch case the program will call appropriate functions to do the task.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education