{"id":231968,"date":"2023-01-19T12:24:00","date_gmt":"2023-01-19T09:24:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=231968"},"modified":"2023-02-04T17:24:41","modified_gmt":"2023-02-04T14:24:41","slug":"prosty-kalkulator-hipoteczny-zaimplementowany-w-c-c-javascript-i-mysql","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/pl\/prosty-kalkulator-hipoteczny-zaimplementowany-w-c-c-javascript-i-mysql\/","title":{"rendered":"Prosty kalkulator hipoteczny zaimplementowany w C\/C++, JavaScript i MySQL"},"content":{"rendered":"<p>Chocia\u017c istnieje wiele dost\u0119pnych kalkulator\u00f3w <a href=\"https:\/\/helloacm.com\/how-to-calculate-mortgage-monthly-payment-using-excel-with-formula\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">hipotecznych<\/a>, zasada prostego kalkulatora hipotecznego jest naprawd\u0119 prosta i opiera si\u0119 na nast\u0119puj\u0105cym wzorze matematycznym.<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-156659-61e5c2d32c6ed.png\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-156659-61e5c2d32c6ed.png\" alt=\"Prosty kalkulator hipoteczny zaimplementowany w C\/C++, JavaScript i MySQL\"><\/a><\/p>\n<p>gdzie c to miesi\u0119czna sp\u0142ata, r to miesi\u0119czne odsetki (co stanowi jedn\u0105 dwunast\u0105 rocznych odsetek). P to suma po\u017cyczonych pieni\u0119dzy. N to ca\u0142kowita liczba sp\u0142at (np. liczba miesi\u0119cy).<\/p>\n<h3>Prosty kalkulator hipoteczny zaimplementowany w MySQL<\/h3>\n<p>Na przyk\u0142ad po\u017cyczy\u0142em 170K od banku HSBC, oprocentowanie (rocznie) wynosi 2,49%, a za 25 lat musz\u0119 sp\u0142aci\u0107 zasad\u0119 + odsetki. Kwot\u0119 sp\u0142aty ka\u017cdego miesi\u0105ca (za\u0142\u00f3\u017cmy, \u017ce jest to sta\u0142a stawka) mo\u017cna obliczy\u0107 za pomoc\u0105 nast\u0119puj\u0105cego polecenia w <a href=\"https:\/\/helloacm.com\/php-script-to-execute-mysql-statements-in-a-text-file\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">konsoli MySQL<\/a> :<\/p>\n<pre><code>mysql&gt; select 0.0249\/12*170000*power(1+0.0249\/12,25*12)\/(power(1+0.0249\/12,25*12)-1);\n+------------------------------------------------------------------------+\n| 0.0249\/12*170000*power(1+0.0249\/12,25*12)\/(power(1+0.0249\/12,25*12)-1) |\n+------------------------------------------------------------------------+\n| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 761.792586559163 |\n+------------------------------------------------------------------------+\n1 row in set (0.00 sec)<\/code><\/pre>\n<h3>Prosty kalkulator hipoteczny zaimplementowany w C\/C++<\/h3>\n<p>W przypadku funkcji pow z math.h funkcja p\u0142atno\u015bci jest zdefiniowana w nast\u0119puj\u0105cy spos\u00f3b:<\/p>\n<pre><code>#include &lt;math.h&gt;\n\u00a0\n\/\/ r - monthly interest rate\n\/\/ p - principle\n\/\/ n - number of repayments\ndouble payment(r, p, n) {\n\u00a0 \u00a0 var x = pow(1 + r, n);\n\u00a0 \u00a0 return r * p * x \/ (x - 1);\n}<\/code><\/pre>\n<h3>Prosty kalkulator hipoteczny online zaimplementowany w JavaScript<\/h3>\n<p>Podobnie funkcja zdefiniowana w <a href=\"https:\/\/wordpress.mediadoma.com\/pl\/jak-automatycznie-wypelnic-formularz-komentarza-za-pomoca-javascript\/\" title=\"JavaScript\">JavaScript<\/a> jest zdefiniowana jako:<\/p>\n<pre><code>\/\/ r - monthly interest rate\n\/\/ p - principle\n\/\/ n - number of repayments\nfunction payment(r, p, n) {\n\u00a0 \u00a0 var x = Math.pow(1 + r, n);\n\u00a0 \u00a0 return r * p * x \/ (x - 1);\n}<\/code><\/pre>\n<p>Wpisz warto\u015bci r, P i N, a poni\u017cszy <a href=\"https:\/\/helloacm.com\/the-simple-mortgage-calculator-implemented-in-cc-javascript-and-mysql\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">kalkulator hipoteczny online (otwarty w nowym oknie)<\/a> obliczy miesi\u0119czn\u0105 sp\u0142at\u0119 i odsetki (niedost\u0119pne, je\u015bli przegl\u0105dasz w wersji <a href=\"https:\/\/wordpress.mediadoma.com\/pl\/jak-wlaczyc-amp-z-wordpressem-techniki-optymalizacji-amp-z-wordpress\/\" title=\"Accelerated Mobile Page\">Accelerated Mobile Page<\/a> ):<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-156659-61e5c2d428cbc.jpg\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-156659-61e5c2d428cbc.jpg\" alt=\"Prosty kalkulator hipoteczny zaimplementowany w C\/C++, JavaScript i MySQL\"><\/a><\/p>\n<p>kalkulator hipoteczny z formu\u0142\u0105<\/p>\n<p>Alternatywn\u0105 wersj\u0119 <a href=\"https:\/\/justyy.com\/archives\/3454\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">tego kalkulatora hipotecznego mo\u017cna znale\u017a\u0107 tutaj<\/a>.<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0179r\u00f3d\u0142o nagrywania:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/helloacm.com\" class=\"external external_icon\">helloacm.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prosty kalkulator hipoteczny zaimplementowany w C\/C++, JavaScript i MySQL<\/p>\n","protected":false},"author":1,"featured_media":224427,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[721,919,897],"tags":[1169],"class_list":["post-231968","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-deweloper","category-inny","category-kod","tag-affiai-pl"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/posts\/231968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/comments?post=231968"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/posts\/231968\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/media\/224427"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/media?parent=231968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/categories?post=231968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/pl\/wp-json\/wp\/v2\/tags?post=231968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}