2024-11-12 09:20:30 +00:00
|
|
|
#ifndef CRIMESTATS_H
|
|
|
|
#define CRIMESTATS_H
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2024-11-12 10:17:05 +00:00
|
|
|
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;
|
|
|
|
|
2024-11-12 14:21:12 +00:00
|
|
|
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);
|
|
|
|
|
2024-11-12 09:20:30 +00:00
|
|
|
void split(const std::string& s, char c,std::vector<std::string>& v);
|
|
|
|
|
|
|
|
void Aufg4Main();
|
|
|
|
|
2024-11-12 10:17:05 +00:00
|
|
|
std::string readFile(std::string &filename, std::vector<Crime*> &allCrimes);
|
|
|
|
|
|
|
|
Crime* stringToCrime(std::string &input);
|
2024-11-12 09:20:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif //CRIMESTATS_H
|