Download presentation

Presentation is loading. Please wait.

Published byCaden Coppin Modified over 2 years ago

1
Lecture 12: Engineering Problem 2

2
Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

3
Problem 1 Problem Statement: Payback Period In an investment, success of the business can be evaluated in many ways. One of the indices is “Payback Period”. Definition: Payback period in business and economics refers to the period of time required for the return on an investment to "repay" the sum of the original investment. For example, a $1000 investment which returned $500 per year would have a two year payback period.

4
Problem 1 Example, a project with ฿ 65M investment has profits of ฿ 10M in the first 3 years and ฿ 15M for the latter years. Which year does it take to payback the investment? Answer: at the 6 th year PB after 5 years = PB at year 6

5
Problem 1 Task Write a program that asks for the following data from user – initial investment, – expected yearly profits (incomes). The program will evaluate for the first 10 years and try to find the Payback Period. It will display the yearly balance (the difference between the investment and the accumulative profit). Constraint: Payback period is found when the balance becomes positive. balance = -Investment + Accumulative Profit Note: Accumulative Profit is the summation of profits from the first year until current considering year.

6
Problem 1 Input: Investment Expected Yearly Profits (Incomes) Output Balance PayBack year Algorithm Payback year is found when Balance > 0 Balance = -Investment + Accumulative Profit

7
Problem 1 Part1: Obtain user’s data Use function input to obtain the investment amount the expected yearly profit Simulate for the first 10 years. (for i = 1 : 10) printf("How much do u want to invest?: "); scanf("%f",&invest); for(i=0;i<10;i++) { printf("What is your expected income in year %d: ",i+1); scanf("%f",&income[i]); }

8
Problem 1 Part2: Compute accumulative profit use variable named SumIncome to store the accumulative profit. SumIncome is initialized to zero SumIncome = SumIcone + Income(i) compute the Accumulative profits for 10 years (for i = 1 : 10) sumincome = 0; for(i=0;i<10;i++) { sumincome = sumincome+income[i]; }

9
Problem 1 Part3: Compute and display the balance values use variable named Balance to store the balance Balance = -Invest + SumIncome display the balance value with fprintf compute for 10 years, Balance is an array for(i=0;i<10;i++) { sumincome = sumincome+income[i]; balance[i] = -invest + sumincome; printf("Year %d, expected balance = %.1f \n",i+1,balance[i]); }

10
Problem 1 Part4: Search for Payback period Payback period is found when Balance > 0 sumincome = 0; pbyear = 0;//Do not have payback year yet for(i=0;i<10;i++) { sumincome = sumincome+income[i]; balance[i] = -invest + sumincome; printf("Year %d, expected balance = %.1f \n",i+1,balance[i]); if (balance[i]>0 && pbyear <=0) {pbyear = i+1; printf("Payback year from Year %d \n",pbyear); }

11
Problem 1 Test #1 Project A: investment = ฿ 65M profits of the first three years = ฿ 10M profits of the latter years = ฿ 15 M

12
Problem 1 Test#2 Project B: investment = ฿ 105M profits of the first three years = ฿ 8M profits of the next 3 years = ฿ 12M profits of the latter years = ฿ 15M

13
Problem 2 Problem Statement: Payback Period + Scrap Value In some investment, the invested properties (such as buildings, vehicles, etc) have some values. The values are called “Scrap value”. Therefore, we can count the scrap value as a kind of balance. Scrap may refer to anything that is leftover.

14
Problem 2 Example: A dormitory is built up with ฿ 65M investment. if the owner sells the business, the building has a scrap value which is normally disproportional to time. For example, if sells – within 1 year: scrap value = ฿ 30M – within 5 years: scrap value = ฿ 15M – within 10 years: scrap value = ฿ 5M

15
Problem 2 Assume: scrap value can be modeled as Scrap Value (@ year i) = Invest/ (Year + 0.5) Ex. Year 1: Scrap Value (1) = 65/(1 + 0.5) = 43.33 Year 2: Scrap Value (2) = 65/(2 + 0.5) = 26.00 Year 3: Scrap Value (3) = 65/(3 + 0.5) = 18.57 … thus Balance = - Invest + SumIncome + Scrap(@ year i);

16
Problem 2 Task Write a program that asks for the following data from user – initial investment, – expected yearly profits. The program will evaluate for the first 10 years and try to find the Payback Period. It will display the yearly balance. The yearly balance must include the scrap value as well. Constraint: Payback period is found when the balance becomes positive. Balance = -Investment + Accumulative Profit +Scrap Value(@year i) Scrap Value = Invest/ (Year + 0.5)

17
Problem 2 Additional codes Compute for the yearly Scrap Values scrap[i] = invest/(i+1+0.5); edit the computation of Balance balance[i] = -invest + sumincome + scrap[i];

18
Problem 2 Test #1 Project A: investment = ฿ 65M profits of the first three years = ฿ 10M profits of the latter years = ฿ 15 M

19
Problem 2 Test#2 Project B: investment = ฿ 105M profits of the first three years = ฿ 8M profits of the next 3 years = ฿ 12M profits of the latter years = ฿ 15M

Similar presentations

OK

2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Functions Outline 3.12Recursion 3.13Example Using Recursion: The Fibonacci Series 3.14Recursion.

2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Functions Outline 3.12Recursion 3.13Example Using Recursion: The Fibonacci Series 3.14Recursion.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google