write C++ program using classes, using sum of the years\'s digits to depreciate
ID: 3647786 • Letter: W
Question
write C++ program using classes, using sum of the years's digits to depreciate (by 1/15 in reverse order for 5 years, where year1=[5/15]*1000,year2=[4/15]*1000, year3=[3/15]*1000, and year4=[2/15]*1000 and year5=[1/15]*1000) for years 1 -5, and the accumulated depreciation = 333.33(yr1), 599.99(yr2), 799.99(yr3), 933.33(yr4), 1000.00(yr5);where Cost = $1100.00, Scrap = $100.00 and Lifeyears = 5 years.Explanation / Answer
void __fastcall TForm1::btnCalculateClick(TObject *Sender) { Extended DeprecYear1, DeprecYearN, Cost, Salvage; int Life; Cost = StrToFloat(edtCost->Text); Salvage = StrToFloat(edtSalvage->Text); Life = StrToInt(edtLife->Text); DeprecYear1 = SYDDepreciation(Cost, Salvage, Life, 1); DeprecYearN = SYDDepreciation(Cost, Salvage, Life, Life); edtYear1->Text = FloatToStrF(DeprecYear1, ffCurrency, 8, 2); edtYearN->Text = FloatToStrF(DeprecYearN, ffCurrency, 8, 2); }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.