Stock Portfolio Analysis - Investment Club Report, Shares Value

Verified

Added on  2019/09/16

|1
|346
|264
Homework Assignment
AI Summary
The assignment focuses on creating a Python program to analyze a stock portfolio for an Investment Club. The program utilizes functions to calculate the current value of each stock based on user-inputted prices. It includes functions for inputting stock prices, calculating current values, and displaying a formatted report. The program also incorporates a function to handle potential changes in the portfolio, allowing users to update the number of shares for a specific company. The final output displays the company name, number of shares, stock price, and current value for each stock in the portfolio, providing a comprehensive financial report. The program demonstrates practical application of functions and data manipulation in a finance context.
Document Page
Stock Program
FUNCTIONS
You are the treasurer of the Investment Club. Listed below are the stocks in your portfolio.
Stock
Number
of Shares
Columbia Sportswear 15
Dean Foods 20
Harley Davidson 12
At each meeting you are required to give a report the value of the stocks in the portfolio. You decide to write a
program (using functions, of course) to calculate the current worth of each stock.
In the main scope of the program, create global constants for the stock name and number of shares (this
data doesn’t change each month).
Write a function to input for the current price of the stock (this changes constantly). Include the name of
the company in each question (as a variable).
What is the current price of Columbia Sportswear? 44.47
What is the current price of Dean Foods? 36.68
What is the current price of Harley Davidson? 49.08
Write a function to calculate the current value for each company.
Write a function to display the following
Wall Street Society
Treasurer: Your Name
Company Name # of Shares Price Current Value
Columbia Sportswear 15 44.47 667.05
Dean Foods 20 36.68 733.60
Harley Davidson 12 49.08 588.96
Extra Credit:
Write a function to ask if any portfolio changes have been made. If the user answers yes, allow them to
change the number of shares for the company that they choose. For example…
Are there any changes to your portfolio (y or n)? y
Which company's shares changed? Dean Foods
How many shares of Dean Foods do you own now? 25
Thanks! Your records have been updated.
Company Name # of Shares Price Current Value
Columbia Sportswear 15 44.47 667.05
Dean Foods 25 36.68 917.00
Harley Davidson 12 49.08 588.96
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
[object Object]