Latest Posts:

Depreciation Program using pascal .




program DepreciationProgram;
uses crt;
label Return;
var
method,years,years2,life,sumofyears:integer;
originalValue,depreciation,depfactor:real;
remainingvalue:real;
begin
return:Clrscr();
writeln('Select 1 for Straight Line Method:');
writeln('select 2 for Double decline Balance Method:');
writeln('Select 3 for Sum-of-the-years digit method:');
writeln('Select an integer for the method to be used for depreciation');
readln(method);
if(method=1)then
begin
clrscr();
writeln('You have selected the straight line metheod');
writeln('Can you give the original value of the item pls?');
readln(originalValue);
writeln('What about its life?');
readln(life);
writeln('Thank you.......');
depreciation:=originalValue/life;
writeln(depreciation);
writeln('Year Remaining Value Depreciation');
for years:=1 to life do
begin
//clrscr();
originalValue:=originalValue-depreciation;
writeln('',years,'',originalValue:10:3,'',depreciation:10:3);
end;
end;
readln();
if(method=2)then
begin
writeln('You have selected the Double Declining Balance method');
writeln('Give the original value of the item pls?');
readln(originalValue);
writeln('What about its life?');
readln(life);
writeln('Thank you......');
depfactor:=2/life;
writeln(depfactor);
depreciation:=0;
writeln('Year Remaining Value Depreciation');
for years:=1 to life do
begin
depreciation:=depfactor*originalValue;
remainingvalue:=originalValue-depreciation;
writeln('',years,'',remainingvalue:10:3,'',depreciation:10:3);
originalValue:=remainingvalue;
end;
end;
readln();
if(method=3)then
begin
clrscr();
writeln('You have selected the sumof the year digit method');
writeln('Give the original value of the item pls?');
readln(originalValue);
writeln('Type in life?');
readln(life);
writeln('Thank you......');
depfactor:=life/55;
writeln(depfactor);
depreciation:=0;
writeln('Year Remaining Value Depreciation');
for years:=1 to life do
begin
depreciation:=depfactor*originalValue;
remainingvalue:=originalValue-depreciation;
writeln('',years,'',remainingvalue:10:3,'',depreciation:10:3);
originalValue:=remainingvalue;
end;
end;
readln();

end.
Share on Google Plus

About Lucky Ibitubo

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Powered by Blogger.