From 9b393734c3f700a5386459f508c076d3b0cb7421 Mon Sep 17 00:00:00 2001 From: fdlt3817 Date: Fri, 10 Feb 2023 10:18:04 +0100 Subject: [PATCH] Refactor insterest calculator, remove unncessary files --- .../Contents/Resources/DWARF/depositMoney | Bin 13673 -> 0 bytes src/interestCalculator.c | 26 +++++++----------- .../DWARF/updateCustomerAccountBalance | Bin 13145 -> 0 bytes 3 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 src/depositMoney.dSYM/Contents/Resources/DWARF/depositMoney delete mode 100644 src/updateCustomerAccountBalance.dSYM/Contents/Resources/DWARF/updateCustomerAccountBalance diff --git a/src/depositMoney.dSYM/Contents/Resources/DWARF/depositMoney b/src/depositMoney.dSYM/Contents/Resources/DWARF/depositMoney deleted file mode 100644 index b151b7849824fbaa1457a64fb7ba046f7e2aab41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13673 zcmeHOdvF}ZneW}%9`8e|mG!{#D+nwb85^x|6yq4jwm_1tm28Zp#EuCJyQ`73XkYBZ zvN;!WRt_;24%y^!=71DQ$Q^Z<3y-QKC7c54$i+#xa}qlVm5{oEdsHsr5|`qfkKA3j z->+vzvgAida&>=gt9tr-_19m2-97vDbnE1A{{6QVLbwEyAK8n1r%udDi&4}ge`)CO zKu>4u&kmisX{vMW@UAsBT~!o8Xh24C+jLPSL;&zJDBnW45P2)IVeDwz(y_av_ZA>? zlBH`7aSlp7uR+i-`a5>@&t|Inn`hG;OagE+X@*fS_ZA%Ph581XEvKBOQ|!dPO(%~y zFbxARjC`RO%TJT$+PCigmcBF75|*zV)NAX*Sg2$e@q8hdNDocpv-{h$-qQD!#}=4V z%(4|c=*y(@Gaa65->Hq3z7uowTnaUeVtO=@9xxK=!Hm*B+rCFPS^5UfQ!v-2^H^$r z994SS+xpv#n{V0PXN~S=OOHT#v7~{>%(2H*LqCTyGrc5!aeYrh)=8}IBu@QW2SGVA zZ+p77cXzaRSyl;-zM5}rl*uk1RYZ$tgNjW(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2=U=eB5sQFC*F*IXYblYG{uAZ z{!F`d)GyRY{a`W^#j*NL_%tCB=>il+bE31WrvtYJ@>ZD@2JQ=t;#NR1I)wYqY8n`^ zL183ggZacgIHQkeG9w9=$xI#vXN55Gra6LoxkLe^Vocx)LLnCg2yI177-6K^) zB{Nv@d^o+?1)#0Bx9!75U)SyqqyNJ@It)W>?Q3Irp#GhM|GiMbmj)7PE}@HekQ|&a zUbiZq#*0)i*i+f&c@eQe)Eye<46Cy;hCqq>TdYJ@r5V1y?NKzU+mAAOJBL~ z?~Zg29X$85x)~96QdL2t86~w zN#ghOfyB6u;Cx$Ng}uPtHlL9N!7thM8M6{MZN7^7fxj1-Nk#A|M-_&DPqF=Gi(k}l zj!Y%$FxT64@#}=Pbo`=8`~?8fn^ybuF%xC@0;hk8)5k11MtH+3nE09S>y?kZad+sc zd)f=PHU3YvTr^9SKoen$IJimKP?9i1-^e~ch&NyyZ`Kc z?_|%NhK`>j(;o|wTadRP-+^32egOFk$dkz5MgA%BJIGhteq&tMh>g?NA65=#bOx?q z5C?K-Gz`G{;V1b3x`N9>SN`?62TA7dILZ92hV;qtt$#`KT3ZQ&IQ+6jo;cS>GUGW) zGr)tAhZ7^8B$;6!$&3J?Wakh6M3EWlkjyX%O18AVv6Iq_he&2P0qNSipT+-DSn&$U z3}c|XT@EEkW_U?50~<&`(X?Kz3r15UGgJh*>%MvbLNKl&nV}BI5AST`3|9dV$&8Dj Td*!*%2+7W@AdBf@EAD>*7PecZ diff --git a/src/interestCalculator.c b/src/interestCalculator.c index a561d55..407e2d9 100644 --- a/src/interestCalculator.c +++ b/src/interestCalculator.c @@ -23,22 +23,19 @@ void calculateYearlyInterest(){ float timeInYears; printf("Please enter the principal amount:"); - scanf("%f",&principalAmount); - if(principalAmount<=0){ + if (scanf("%f", &principalAmount) != 1 || principalAmount <= 0) { troubleshoot(0); return; } printf("\nPlease enter interest per year (percentage):"); - scanf("%f",&interestPerYear); - if(interestPerYear<=0){ - troubleshoot(1); + if (scanf("%f", &interestPerYear) != 1 || interestPerYear <= 0) { + troubleshoot(0); return; } printf("\nPlease enter interest time in years:"); - scanf("%f",&timeInYears); - if(timeInYears<=0){ + if (scanf("%f", &timeInYears) != 1 || timeInYears <= 0) { troubleshoot(2); return; } @@ -46,7 +43,7 @@ void calculateYearlyInterest(){ float interestDecimal=interestPerYear/100; float result= principalAmount*(1+(interestDecimal*timeInYears)); - printf("\nAmount with the interest is %.2f.",result); + printf("\nAmount with the interest is %.2f€.",result); } void calculateMonthlyInterest(){ float principalAmount; @@ -54,22 +51,19 @@ void calculateMonthlyInterest(){ float timeInMonths; printf("Please enter the principal amount:"); - scanf("%f",&principalAmount); - if(principalAmount<=0){ + if (scanf("%f", &principalAmount) != 1 || principalAmount <= 0) { troubleshoot(0); return; } printf("\nPlease enter interest per month (percentage):"); - scanf("%f",&interestPerMonth); - if(interestPerMonth<=0){ - troubleshoot(1); + if (scanf("%f", &interestPerMonth) != 1 || interestPerMonth <= 0) { + troubleshoot(0); return; } printf("\nPlease enter interest time in months:"); - scanf("%f",&timeInMonths); - if(timeInMonths<=0){ + if (scanf("%f", &timeInMonths) != 1 || timeInMonths <= 0) { troubleshoot(2); return; } @@ -77,7 +71,7 @@ void calculateMonthlyInterest(){ float interestDecimal=interestPerMonth/100; float result= principalAmount*(1+(interestDecimal*timeInMonths)); - printf("\nAmount with the interest is %.2f.",result); + printf("\nAmount with the interest is %.2f€.",result); } void initiateCalculator(){ diff --git a/src/updateCustomerAccountBalance.dSYM/Contents/Resources/DWARF/updateCustomerAccountBalance b/src/updateCustomerAccountBalance.dSYM/Contents/Resources/DWARF/updateCustomerAccountBalance deleted file mode 100644 index 9360d10b2a431a5a7c5f0f7492a115eb023df72d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13145 zcmeHOdvH|M89%!x=dzo<*}NgVhHVKN1hNr>JVZz&fn*Z|5;_EYT<&gek~RAX`yfD5 zqZ_pNr~w~i5L&U)*0H67o&MnfR&8m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