联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2021-02-21 10:05

BUS 104 Introduction to Computational Thinking

Lab Assignment #4

Spring 2021

This assignment must be turned into Canvas before midnight on the day of your lab session. You may

help each other and work together, but it is imperative that you do your own work. Remember that not

only is academic dishonesty a serious, punishable offense, but you are also bound by the Code of Love

and Honor. Do not cheat.

PROBLEM DESCRIPTION

When developing a capital budget, an organization typically evaluates a number of alternative projects.

In this lab you will expand your Net Present Value calculator to evaluate multiple projects. The program

will calculate and display the NPV of each project. The program will also inform the user of the best

project to implement based on the highest calculated Net Present Value for all project options.

As a reminder, the formula for the net present value calculation is shown below:

?????? is the net present value, n is the final time period, t is the time period being evaluated,

??????

is the cash flow at time period t, and k is the cost of capital

The following two projects will be evaluated using the new program as a test case.

WHAT YOU NEED TO DO

Write a lab program to add the following features to your Net Present Value calculator:

? An outer loop to allow the user to evaluate multiple projects. After each project is evaluated,

the program will ask the user if they would like to calculate the NPV for another project. The

loop will end when the user enters a negative response to that question. Make sure your

program clearly tells the user what they must enter to end the outer loop. Even though the test

case has only two projects, the program should accept any number of projects.

? Before each project is evaluated, the user will be asked to input the name of the project, the

cost of capital, and the time periods. The cost of capital and time periods cannot be hardcoded

like they were in the homework, since they may vary by project. Make sure your program

clearly tells the user how the cost of capital and time period should be entered. Will cost of

capital be entered as a whole percentage (and then divided by 100), or as a decimal? Should the

user enter the number of the last time period or the total time periods for the project? That will

affect the subsequent calculations.

? The loop evaluating each program will be similar to the homework. The cash flow entries,

output of the present value at each time period, and output of the net present value of each

project will be similar to the homework.

? The program will no longer recommend acceptance or rejection for each project. Instead, two

variables should be initialized before the outer loop begins to track the best project’s name and

the best net present value. (Hint: Initialize the best project’s name to something like none and

the best net present value to 0.) After each project’s net present value is calculated, determine

if it’s better than the best net present value calculated so far. If it is, update the best project’s

name variable and the best net present value variable to the information for the current project.

? After all projects are evaluated the program should print out the name of the best project for

the firm to include in their capital budget. Using the test case for this lab, the recommendation

would be to choose project X-Ray.

Remember, before you submit, to write a short “preamble” for your program—a few sentences in a

block comment with your name and section that broadly describe the function and purpose of the

program. Also, check that you have included sufficient inline comments and that you have tested and

saved your final version before submitting the web page URL.

On the next page is an example of the dialog between the user and the program when running the test

case.

This program will calculate the Net Present Value of multiple investment

options.

What is the name of the project to be evaluated? Delta

What is the cost of capital as a decimal? 0.04

What is the final time period? 3

Enter the cash flow information for project Delta:

What is the cash flow at time period 0? -10000.75

The present value of cash flow 0 is: $-10001

What is the cash flow at time period 1? 3500

The present value of cash flow 1 is: $3365

What is the cash flow at time period 2? 3500

The present value of cash flow 2 is: $3236

What is the cash flow at time period 3? 3500

The present value of cash flow 3 is: $3111

The Net Present Value of project Delta is: $-288

Would you like to evaluate another project (Y, N)? Y

What is the name of the project to be evaluated? X-Ray

What is the cost of capital as a decimal? 0.08

What is the final time period? 4

Enter the cash flow information for project X-Ray:

What is the cash flow at time period 0? -10000.75

The present value of cash flow 0 is: $-10001

What is the cash flow at time period 1? 5500

The present value of cash flow 1 is: $5093

What is the cash flow at time period 2? 3000

The present value of cash flow 2 is: $2572

What is the cash flow at time period 3? 3000

The present value of cash flow 3 is: $2381

What is the cash flow at time period 4? 1000

The present value of cash flow 4 is: $735

The Net Present Value of project X-Ray is: $780

Would you like to evaluate another project (Y, N)? N

The firm should choose project X-Ray.


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp