Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

Thread: how to make program of Depreciation using if statement and loops

1. 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....

2. 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?

3. 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)

4. Re: how to make program of Depreciation using if statement and loops

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

5. 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....

6. 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.