@date November 2017 - Pastebin.com

Loading...

P A S TE B IN

new paste

trends



API



tools



faq

search...





Untitled A GUEST

DEC 5TH, 2017

53

NEVER

Guest User





-

SHARE

Public Pastes

TWEET

Untitled 4 sec ago Untitled 4 sec ago Untitled 4 sec ago Untitled 8 sec ago Untitled 9 sec ago Untitled 12 sec ago MApping LSRP 13 sec ago

Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

Untitled CSS | 13 sec ago daily pastebin

11.97 KB

goal 29%

1. ///@author Jan Kollarik 2. ///@date November 2017

help support pastebin

3. ///@mainpage KOL0411 - Sport tracker 4. 5. #include 6. #include 7. #include 8. #include 9. 10. using namespace std; 11. 12. int *counter = (int*)malloc(sizeof(int)); 13. unsigned int opt=0; 14. unsigned int nsos; 15. bool inserted=false; 16. 17. /**@struct Activity 18. *@brief Struktura popisujici aktivitu 19. *@param Acitivity.ID - jedinecny identifikator aktivity 20. *@param Activity.date - datum konani aktivity 21. *@param Activity.type - typ aktivity 22. *@param Activity.dist - vzdalenost prekonana behem aktivity 23. *@param Activity.time - doba trvani aktivity 24. *@param Activity.calories - odhad spalenych kalorii behem aktivity 25. */ 26. typedef struct{ 27. int ID; 28. string date; 29. string type; 30. double dist; 31. double time; 32. double calories; 33. } Activity; 34. 35. /**@struct InsertedActs 36. *@brief Pomocna struktura pro zadane aktivity 37. *@param Acitivity.ID - jedinecny identifikator aktivity 38. *@param Activity.date - datum konani aktivity 39. *@param Activity.type - typ aktivity 40. *@param Activity.dist - vzdalenost prekonana behem aktivity 41. *@param Activity.time - doba trvani aktivity 42. *@param Activity.calories - odhad spalenych kalorii behem aktivity 43. */ 44. typedef struct{ 45. int ID; 46. string date; 47. string type; 48. double dist; 49. double time; 50. double calories; 51. } InsertedActs; 52. 53. /**@brief Funkce pocitajici pocet radku v csv soubor 54. *@param vstupni datovy proud 55. *@return Pocet radku 56. */ 57. int rowCount(ifstream& file) 58. { 59. string s; 60. int rcount=0; 61. while(getline(file,s)) 62. { 63. rcount++; 64. } 65. file.clear(); 66. file.seekg(0,ios::beg); 67. return rcount; 68. } 69. 70. /**@brief Funkce pro nahrani dat ze souboru do struktury 71. *@param struktura 72. *@param vstupni proud 73. */ 74. void fillStruct(Activity act[],ifstream& input) 75. { 76. string row,sid,sdist,stime,scal; 77. int ord=0; 78. int position; 79. while(getline(input,row)) 80. { 81. sid=""; 82. sdist=""; 83. stime=""; 84. scal=""; 85. position=0; 86. for(unsigned int i=0;i> name; 131. return name; 132. } 133. 134. /**@brief Funkce pro vlozeni html hlavicky 135. *@return html hlavicka 136. */ 137. string htmlHead() 138. { 139. string s= "" 140. "" 141. "Sport trackerThe Vietnam War | Palco MP3 | Flipagram"; 142. return s; 143. } 144. 145. /**@brief Funkce pro vypsani dat vybraneho mesice do html 146. *@param struktura 147. *@param pocet prvku struktury 148. */ 149. void monthHtml(Activity act[], int sos) 150. { 151. string name=fileName(); 152. ofstream htmlmonOutput(("..\\vystupy\\"+name+".html").c_str()); 153. htmlmonOutput<> monthNum; 158. int pos=0; 159. double speed=0; 160. for (unsigned int i=0;i"<"; 171. for(unsigned int i=0;i"; 176. } 177. } 178. for(unsigned int i=0;i"; 183. } 184. } 185. for(unsigned int i=0;i"; 190. } 191. } 192. for(unsigned int i=0;i"; 197. } 198. } 199. htmlmonOutput << "
IDDatum TypVzdalenostCasKalorie"<< act[counter[i]].ID <<""<< act[counter[i]].date <<""<< act[counter[i]].type <<""<< act[counter[i]].dist <<""<< act[counter[i]].time <<""<< act[counter[i]].calories<<"
"<< act[counter[i]].ID <<""<< act[counter[i]].date <<""<< act[counter[i]].type <<""<< act[counter[i]].dist <<""<< act[counter[i]].time <<""<< act[counter[i]].calories<<"
"<< act[counter[i]].ID <<""<< act[counter[i]].date <<""<< act[counter[i]].type <<""<< act[counter[i]].dist <<""<< act[counter[i]].time <<""<< act[counter[i]].calories<<"
"<< act[counter[i]].ID <<""<< act[counter[i]].date <<""<< act[counter[i]].type <<""<< act[counter[i]].dist <<""<< act[counter[i]].time <<""<< act[counter[i]].calories<<"
Prumerna rychlost"<
"; 200. free(counter); 201. } 202. 203. /**@brief Funkce pro vypsani dat vybraneho mesice do html 204. *@param pole s cetnostmi aktivit 205. *@return index nejvetsiho prvku v poli 206. */ 207. int maxindex(int arr[]) 208. { 209. int maxval = arr[0]; 210. int max = 0; 211. for (unsigned int i = 0; i < 4; i++) 212. { 213. if (maxval"<"<"<"<"<"<"; 235. } 236. } 237. } 238. 239. /**@brief Funkce pro sber dat na rocni vystup 240. *@param struktura aktivit 241. *@param pocet prvku struktury 242. */ 243. void yearHtml(Activity act[],int sos) 244. { 245. string name = fileName(); 246. ofstream htmlyearOutput(("..\\vystupy\\"+name+".html").c_str()); 247. htmlyearOutput<IDDatumTypVzdalenostCasKalorie"; 271. for (unsigned int i=0;i<4;i++) 272. { 273. indexOfType=maxindex(countArr); 274. switch(indexOfType) 275. { 276. case 0: 277. type="beh"; 278. writeToYearHtml(htmlyearOutput,type,sos,act); 279. break; 280. case 1: 281. type="kolo"; 282. writeToYearHtml(htmlyearOutput,type,sos,act); 283. break; 284. case 2: 285. type="chuze"; 286. writeToYearHtml(htmlyearOutput,type,sos,act); 287. break; 288. case 3: 289. type="inline"; 290. writeToYearHtml(htmlyearOutput,type,sos,act); 291. break; 292. } 293. countArr[indexOfType]=0; 294. } 295. htmlyearOutput<<" "; 296. htmlyearOutput.flush(); 297. htmlyearOutput.close(); 298. } 299. 300. /**@brief Funkce pro vypocet spalenych kalorii 301. *@param doba trvani aktivity 302. *@param typ aktivity 303. *@return pocet spalenych kalorii 304. */ 305. double countCalories(double tm, string tp) 306. { 307. if(tp=="chuze") 308. { 309. return 20*tm; 310. } 311. if(tp=="beh") 312. { 313. return 40*tm; 314. } 315. if(tp=="kolo") 316. { 317. return 30*tm; 318. } 319. if(tp=="inline") 320. { 321. return 35*tm; 322. } 323. } 324. 325. /**@brief Funkce pro vlozeni dat do pomocne struktury 326. *@param pocet prvku ve strukture 327. *@param pomocna struktura 328. */ 329. void insertActs(int cid,InsertedActs iact[]) 330. { 331. string dat,tp; 332. double dt,tm; 333. for (unsigned int i=0;i> dat; 338. cout << "zadejte typ aktivity (chuze,beh,kolo,inline): "; 339. cin >> tp; 340. while (tp!="chuze" && tp!="beh" && tp!="kolo" && tp!="inline") 341. { 342. cout << "zadejte spravny typ aktivity" << endl; 343. cin >> tp; 344. } 345. cout << "zadejte prekonanou vzdalenost v km (XX.XX): "; 346. cin >> dt; 347. cout << "zadejte dobu aktivity v minutach (XX.XX): "; 348. cin >> tm; 349. cout << "automaticky byl vlozen odhad spalenych kalorii" << endl; 350. cout << endl; 351. iact[i].ID = cid+1; 352. iact[i].date = dat; 353. iact[i].type = tp; 354. iact[i].dist = dt; 355. iact[i].time = tm; 356. iact[i].calories = countCalories(tm,tp); 357. cid++; 358. } 359. inserted=true; 360. } 361. 362. /**@brief Funkce pro vlozeni dat z pomocne struktury do csv souboru 363. *@param pomocna struktura 364. */ 365. void dataOut(InsertedActs iact[]) 366. { 367. ofstream out("..\\vstupni\\data.csv",ios_base::app); 368. for(unsigned int i=0;i> opt; 395. if(opt==1) 396. { 397. if(!inserted) 398. { 399. cout << "zadejte, kolik aktivit chcete zadat: "; 400. cin >> nsos; 401. insertActs(sos,iact); 402. } 403. cout << "data uz byla vlozena" << endl; 404. menu(act,sos,iact); 405. } 406. if(opt==2) 407. { 408. monthHtml(act,sos); 409. menu(act,sos,iact); 410. } 411. if(opt==3) 412. { 413. yearHtml(act,sos); 414. menu(act,sos,iact); 415. } 416. if(opt==4) 417. { 418. dataOut(iact); 419. exit(0); 420. } 421. } 422. 423. int main() 424. { 425. ifstream inputFile("..\\vstupni\\data.csv"); 426. 427. if(!inputFile.is_open()) 428. { 429. cout << "nastala chyba!" << endl; 430. return 0; 431. } 432. 433. int sos=rowCount(inputFile); 434. Activity act[sos]; 435. InsertedActs iact[100]; 436. fillStruct(act,inputFile); 437. menu(act,sos,iact); 438. return 0; 439. }

RAW Paste Data ///@author Jan Kollarik ///@date November 2017 ///@mainpage KOL0411 - Sport tracker #include #include #include #include using namespace std; int *counter = (int*)malloc(sizeof(int)); unsigned int opt=0; unsigned int nsos; bool inserted=false; /**@struct Activity *@brief Struktura popisujici aktivitu *@param Acitivity.ID - jedinecny identifikator aktivity *@param Activity.date - datum konani aktivity *@param Activity.type - typ aktivity *@param Activity.dist - vzdalenost prekonana behem aktivity *@param Activity.time - doba trvani aktivity *@param Activity.calories - odhad spalenych kalorii behem aktivity */ typedef struct{ int ID; string date; string type; double dist; double time; double calories; } Activity; /**@struct InsertedActs *@brief Pomocna struktura pro zadane aktivity *@param Acitivity.ID - jedinecny identifikator aktivity *@param Activity.date - datum konani aktivity *@param Activity.type - typ aktivity *@param Activity.dist - vzdalenost prekonana behem aktivity *@param Activity.time - doba trvani aktivity

















*@param Activity.calories - odhad spalenych kalorii behem aktivity */ typedef struct{ new! / api / trends / syntax languages / faq / tools / privacy / cookies / contact / dmca / scraping / go create new paste / deals int ID; Site design & logo © 2017 Pastebin; user contributions (pastes) licensed under cc by-sa 3.0 -- Dedicated Server Hosting by Steadfast string date; string type; double dist; double time;



SEE HOW YOUR VISITORS ARE REALLY USING YOUR WEBSITE.



Loading...

@date November 2017 - Pastebin.com

P A S TE B IN new paste trends API tools faq search... Untitled A GUEST DEC 5TH, 2017 53 NEVER Guest User - SH...

233KB Sizes 3 Downloads 18 Views

Recommend Documents

Items filtered by date: Wednesday, 01 November 2017 - Imphal Times
Nov 1, 2017 - Imphal, Nov.1: Thongram Rameshwar Chicken Center of Sagolband Khamnam Bazar has donated a sum of Rs. 25,00

November 2017 ember 2017
Nov 1, 2017 - ember 2017. Sunday. Monday. Tuesday. Wednesday. Thursday. Friday. Saturday. 1. Preschool St eschool Storyt

November 2017 examination schedule
Nov 15, 2017 - Morning examinations must start after 0700 hours and finish by 1300 hours local time. Afternoon examinati

DEFENSE STUDIES: November 2017
Nov 3, 2017 - Penamaan Nagapasa pada kapal selam TNI AL diambil dari anak panah Indrajit dan diyakini mampu melaksanakan

november | 2017 | zxjavmd
Nov 3, 2017 - 14 Jun 2016 Light microscopy has a number of applications in different sectors including in gemmology, met

November 2017 - The Seavingtons
Nov 10, 2017 - November 2017. 1. Life as editor of this village journal is punctuated by regular events and news items.

November | 2017 | Pumpkin books
Styliform curly iso iwa 1 pdf jonathan pigeonholed their unfetters rowdies and chiack barefoot. laxa ablation convenient

november | 2017 | omhzjat
Nov 21, 2017 - phrases traduites contenant “pdf converter” – Dictionnaire francais-anglais et lance en Octobre, co

november | 2017 | avqwavs
Nov 23, 2017 - Overview · Specs · Gallery · Reviews & Downloads manual |paradigm monitor 90p manual muscle |hp 5 ps4

A - November 29, 2017
Nov 29, 2017 - In accordance with Item 9.01(a)(4) of Form 8-K, Troika Media Group, Inc. (the "Company") is filing on thi