首页 >
> 详细

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.

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp2

- Cs2461-10实验程序代做、代写java，C/C++，Python编程设 2021-03-02
- 代写program程序语言、代做python，C++课程程序、代写java编 2021-03-02
- Programming课程代做、代写c++程序语言、Algorithms编程 2021-03-02
- 代写csc1-Ua程序、代做java编程设计、Java实验编程代做 代做留学 2021-03-02
- 代做program编程语言、代写python程序、代做python设计编程 2021-03-02
- 代写data编程设计、代做python语言程序、Python课程编程代写 代 2021-03-02
- Cse 13S程序实验代做、代写c++编程、C/C++程序语言调试 代写留学 2021-03-02
- Mat136h5编程代做、C/C++程序调试、Python，Java编程设计 2021-03-01
- 代写ee425x实验编程、代做python，C++，Java程序设计 帮做c 2021-03-01
- Cscc11程序课程代做、代写python程序设计、Python编程调试 代 2021-03-01
- 代写program编程、Python语言程序调试、Python编程设计代写 2021-03-01
- 代做r语言编程|代做database|代做留学生p... 2021-03-01
- Data Structures代写、代做r编程课程、代做r程序实验 帮做ha 2021-03-01
- 代做data留学生编程、C++，Python语言代写、Java程序代做 代写 2021-03-01
- 代写aps 105编程实验、C/C++程序语言代做 代写r语言程序|代写py 2021-03-01
- Fre6831 Computational Finance 2021-02-28
- Sta141b Assignment 5 Interactive Visu... 2021-02-28
- Eecs2011a-F20 2021-02-28
- Comp-251 Final Asssessment 2021-02-28
- 代写cs1027课程程序、代做java编程语言、代写java留学生编程帮做h 2021-02-28