40 lines
879 B
C++
40 lines
879 B
C++
#ifndef CRIMESTATS_H
|
|
#define CRIMESTATS_H
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
typedef struct CRIME{
|
|
std::string cdatetime;
|
|
std::string address;
|
|
std::string district;
|
|
std::string beat;
|
|
std::string grid;
|
|
std::string crimedescription;
|
|
std::string ucr_ncic_code;
|
|
std::string latitude;
|
|
std::string longitude;
|
|
} Crime;
|
|
|
|
class CRIMESTATS {
|
|
public:
|
|
std::vector<Crime*> crimes;
|
|
int countCrimes();
|
|
std::string getMostCommonCrime();
|
|
std::string getMostDangerousDistrict();
|
|
|
|
std::vector<std::string> *getDuplicateAdresses();
|
|
};
|
|
|
|
bool isInVector(std::string& str, std::vector<std::string>* vec);
|
|
|
|
void split(const std::string& s, char c,std::vector<std::string>& v);
|
|
|
|
void Aufg4Main();
|
|
|
|
std::string readFile(std::string &filename, std::vector<Crime*> &allCrimes);
|
|
|
|
Crime* stringToCrime(std::string &input);
|
|
|
|
|
|
#endif //CRIMESTATS_H
|