Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is C + + you should make ( PJT 3 _ 2 . cpp , PJT 3 _ 2 . h , input.txt ,

this is C++
you should make (PJT3_2.cpp, PJT3_2.h, input.txt, output.txt ) totatal 4 files.
A text file containing city name, country, latitude and longitude is loaded.
This information is stored in the citynaro array.
Output Format
You should write a program that performs the following actions based on the
selected option number
Entering the number 1 will perform the task of printing the list (Task 1).
Entering the number 2 will perform the task of adding data (Task 2).
Entering the number 3 will perform the task of removing data (Task 3).
Entering the number 4 will perform the task of modifying data (Task 4).
Entering the number 5 will perform the task of sorting data (Task 5).
Entering the number 6 will perform the task of saving file (Task 6).
Entering the number 0 will terminate the program and entering a different
number that is not predefined will perform the error message (Task 0).
Example Data
Entering the number 1, perform "Print List" Task.
Entering the number 2, perform "Add Data" Task.
Sample Input
C1ty name: EEP
Country name: EEP22301
Latitude value btw to 90 with N/S (North/South): 80N
Longitutde value btw 0 to 180 with EW(East/west): 98E
Sample Output Entering the number 3, perform "Remove Data" Task.
Sample Input
Enter the city name you want to remove: EEP
Sample Output
Entering the number 4, 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, 1ongitude): latitude
Enter new latitude value btw 0 to 90 with N/S.
45S
Sample Output
Entering the number 5, 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?
(c1ty, country, latitude, long1tude): long1tude
Sample Output
Entering the number 6, perform "Save File" Task.
Sample Input
Enter the file name: Problem 2(PJT3_2.cpp)70pts
Problem statement
For problem 2, read an input text from input.-1xt. 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 2 to 5.
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: floating-point number between [090], inclusive, rounded to two
decimal places, direction must be N or S.
longitude: floating-point number between [0180], inclusive, rounded to two
decimal places, direction must be E or W.
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 2, do not modify
the value.
latitude: floating-point number between [090], inclusive, rounded to two
decimal places, direction must be N or S.
longitude: floating-point number between [0180], inclusive, rounded to two
decimal places, direction must be E or W.
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)090N(90 north),
descending order with 90N090S.
Longitude: ascending order with 180W(1800 west)0180E(180 east),
descending orther with 180E0180W.
If shuffle is selected,
randomly shuffle the current list.
You may use the method used in Problem 1 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!!
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions