Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Input Format A text file containing city name, country, latitude and longitude is loaded. This information is stored in the citynaro array. The input.ce file
Input Format
A text file containing city name, country, latitude and longitude is loaded.
This information is stored in the citynaro array.
The input.ce file is as follows.
Output Format
You should write a program that performs the following actions based on the
selected option number
Entering the number will perform the task of printing the list Task
Entering the number will perform the task of adding data Task
Entering the number will perform the task of removing data Task
Entering the number will perform the task of modifying data Task
Entering the number will perform the task of sorting data Task
Entering the number will perform the task of saving file Task
Entering the number will terminate the program and entering a different
number that is not predefined will perform the error message Task
Example Data
Entering the number perform "Print List" Task.
Entering the number perform "Add Data" Task.
Sample Input
Cty name: EEP
Country name: EEP
Latitude value btw to with NS NorthSouth:
Longitutde value btw to with Eastwest:
Sample Output Entering the number perform "Remove Data" Task.
Sample Input
Enter the city name you want to remove: EEP
Sample Output
Entering the number perform "Modify Data" Task.
Sample Input
Enter the city name you want to modify: Seoul
What information are you going to modify?
city country, latitude, ongitude: latitude
Enter new latitude value btw to with NS
Sample Output
Entering the number perform "Sort Data" Task.
Sample Input
Select an option that you want to sort
ascending descending, shuffle: ascending
Which data do you want to sort?
cty country, latitude, longtude: longtude
Sample Output
Entering the number perform "Save File" Task.
Sample Input
Enter the file name: Problem PJTcpppts
Problem statement
For problem read an input text from input.xt The informations are stored in the
cityInfo arrin or citysmfo wector if you can implement it You should write a program that
performs the following tasks.
Print list
This task is to print in the order stored in the citymifo arriy.
The output must reflect the results of tasks to
Failure to run this task's code will result in a score of zero.
Add Data
This task is to store data city name, country, latitude, and longitude using cin
in the citycifo arriny.
If the entered latitude and longitude values are incorrect, set them to "default"
values. set the "default" values individually and freely
latitude: floatingpoint number between inclusive, rounded to two
decimal places, direction must be or
longitude: floatingpoint number between inclusive, rounded to two
decimal places, direction must be or
Remove Data
This task is to remove the corresponding row to the city name recelved as input.
If there is no matching name, no changes.
Modify Data
This task is to edit data corresponding to the city name received as input.
Firstly, you get the cityzifo related to the city name as input.
Then, you modify one of the values in the city nif. city name, country,
latitude, and longitutde
If modifying the latitude and longitude values, check if the conditions are met.
If the latitude and longitude values are incorrect, as in task do not modify
the value.
latitude: floatingpoint number between inclusive, rounded to two
decimal places, direction must be or
longitude: floatingpoint number between inclusive, rounded to two
decimal places, direction must be or
Sort Data
This task to select one of ascending order, descending order, or shuffle to sort
or shuffle data.
If ascending or descending order is selected.
choose the data to use as the sorting criterion city name, country, latitude, or
longitude
Latitude: ascending order with south north
descending order with
Longitude: ascending order with west east
descending orther with
If shuffle is selected,
randomly shuffle the current list.
You may use the method used in Problem or any other method.
Save File
This task receives a file name as input and saves the list to a text file.
you should see all these pictures!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started