# how to make program of Depreciation using if statement and loops

• June 13th, 2011, 05:45 AM
Pulsifier
how to make program of Depreciation using if statement and loops
This is the condition that my instructor gave:

with every year that goes by the price of the product decreases as follows:
year 1=20%
year 2=29%
year 3=19.5%
year 4=18.5%
year 5=17.5%
year 6=16.5%
year 7=15.5%
year 8=14.5%
year 9=13.5%
year 10=12.5%

how can i make a program using these variables, using only if statement and loops....

• June 13th, 2011, 06:48 AM
vanDarg
Re: how to make program of Depreciation using if statement and loops
What have you tried? Besides the first 3 years, the depreciation seems pretty simple (1%). What are you having trouble with?
• June 13th, 2011, 07:08 AM
JavaPF
Re: how to make program of Depreciation using if statement and loops
Welcome to the forum Pulsifier.

You have posted in the What's wrong with my code forum but you have not posted any code.

Do you know how to use loops and if statements?

http://www.javaprogrammingforums.com...ava-loops.html

The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)
• June 16th, 2011, 09:35 PM
Pulsifier
Re: how to make program of Depreciation using if statement and loops
Quote:

Originally Posted by JavaPF
Welcome to the forum Pulsifier.

You have posted in the What's wrong with my code forum but you have not posted any code.

Do you know how to use loops and if statements?

http://www.javaprogrammingforums.com...ava-loops.html

The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)

That's the problem good Sir.... It's our first week of classes, she haven't taught us anything yet.... so the answer is no... no idea on how to use loop and if statements... sorry
• June 16th, 2011, 09:38 PM
Pulsifier
Re: how to make program of Depreciation using if statement and loops
I have an idea on the first 2 years.. its just that she wants us to get the result of the first year and implement it to the second year, second year's result implement it to the third year and so on....
• June 16th, 2011, 11:23 PM
Junky
Re: how to make program of Depreciation using if statement and loops
Have you learnt arrays? Placing the rates in an array would make things simpler.