Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me calculate cash flow in python! The Problem You work for new startup that is trying to manufacture phones. You are tasked with

Please help me calculate cash flow in python!

The Problem You work for new startup that is trying to manufacture phones. You are tasked with building a model which will help determine how many machines to invest in and how much to spend on marketing. Each machine produces noutput phones per year. Each phone sells for $pphone and costs $cphone in variable costs to produce. After nlife years, the machine can no longer produce output, but may be scrapped for $pscrap. The machine will not be replaced, so you may end up with zero total output before your model time period ends. Equity investment is limited, soineachyearyoucanspend cmachine toeitherbuyamachineorbuyadvertisements. Intherstyearyou must buy a machine. Any other machine purchases must be made one after another (advertising can only begin after machine buying is done). Demand for your phones starts at d1. Each time you advertise, demand increases by gd%. The prevailing market interest rate is r.

Python Exercise You must start from "Project 1 Template.ipynb" on Canvas. I should be able to run all the cells and get the output of your model at the bottom. You should not change the ModelInputs cell and the ModelInputs cell should be the fth cell. You need to dene cash_flows as your output cash ows (numbers, not formatted), and npv as your NPV (number, not formatted). When you show your nal outputs in the notebook, then they should be formatted.

Here's the code for python:

from dataclasses import dataclass import numpy as np

@dataclass class ModelInputs: n_phones: float = 100000 price_scrap: float = 50000 price_phone: float = 2000 cost_machine_adv: float = 1000000 cogs_phone: float = 250 n_life: int = 10 n_machines: int = 5 d_1: float = 100000 g_d: float = 0.2 max_year: float = 20 interest: float = 0.05 # Inputs for bonus problem elasticity: float = 100 demand_constant: float = 300000 model_data = ModelInputs() model_data

cash_flows = # this should ultimately be set to the list containing your cash flow numbers in each year npv = # this should ultimately be set to the overally model npv number

The output should look like this:

You should get the following result:

Cash Flows:

Year 1: $24,000,000

Year 2: $24,000,000

Year 3: $24,000,000

Year 4: $24,000,000

Year 5: $24,000,000

Year 6: $29,000,000

Year 7: $35,000,000

Year 8: $42,200,000

Year 9: $50,840,000

Year 10: $61,208,000

Year 11: $73,699,600

Year 12: $74,050,000

Year 13: $49,050,000

Year 14: $24,050,000

Year 15: $-950,000

Year 16: $-1,000,000

Year 17: $-1,000,000

Year 18: $-1,000,000

Year 19: $-1,000,000

Year 20: $-1,000,000

NPV: $369,276,542

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Finance questions