So I am awful when having to use data or .txt files. I believe my code is right, I just don't know how to upload the files. Please, any help will do. Here is the description of the assignment and the coding:
Process the input file containing latitude and longitude data of US cities in degree, minutes, and seconds. Output the processed information in decimal degrees.
a) Write a C++ program to read each line of the input file, store each data line in an array of structure, calculate the degrees in decimal for latitude and longitude, store these values in the corresponding structure and write the results to the output file by processing the array.
b) Use vectors or dynamic array to optimize memory usage. Specify the design choice in your main comment for the program.
c) Split the City and State and store it in two separate fields.
d) Search a city and find it in the array of structure and print out ALL the information on the screen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include <fstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
struct City
{
string areaCode;
double latitude;
double longitude;
string city;
string state;
};
/**
} */
|