辅导 CS 20A、讲解 C++语言程序
CS 20A: Data Structures with C++
Project 1: Stock portfolio Due: 3/22/2023 @ 11:59PM Goal
In this project, you will create a stock portfolio to keep track of your investments.
Setup
• The GitHub classroom link is posted on Canvas.
• Be sure to follow the setup guide on Canvas.
• You should read this writeup in its entirety before writing any code.
• This assignment has an interactive mode and a testing mode. Main is sparse – you should fill in
code to interact with the user. The file main.cpp is where you should test your code to make
sure all the methods and functions work as expected.
• Part of the assignment revolves around an input file (or multiple files if you want). There’s a
sample input file in the input folder titled purchaseList.txt it has an example of the two types of
input lines you can expect. See the function headers in driver.h for more details about the input.
• The .cpp files are empty. You’ll need to fill them in based on the .h files and this writeup. We
recommend that you fill in the functions in the order below.
File “money.cpp”
• Note the header file – it’s well documented and a good indication of what each function needs to do. Do not change the function declarations in this file. You may add any additional functions to money.h if you need them.
• You should thoroughly test the code in this file. File “stock.cpp”
• Note the header file – it’s well documented and a good indication of what each function needs to do. Do not change the function declarations in this file. You may add any additional functions to stock.h if you need them.
• You should thoroughly test the code in this file. For example, generate several powers in main to test the functions.
File “portfolio.cpp”
• Note the header file – it’s well documented and a good indication of what each function needs to do. Do not change the function declarations in this file. You may add any additional functions to portfolio.h if you need them.
• You should thoroughly test the code in this file. For example, generate several powers in main to test the functions.
Page 1 of 2
File “driver.cpp”
• Note the header file – it’s well documented and a good indication of what each function needs to do. Do not change the function declarations in this file. You may add any additional functions to driver.h if you need them.
• You should thoroughly test the code in this file. For example, generate several powers in main to test the functions.
Hints
1. No main.cpp code is given, so there’s no output to exactly match. However, main is a good place to test things to make sure the input and output makes sense. Soon we’ll be writing code in the studentTests.cpp file though.
A Note on Style
Be sure to comment your code.
As we discussed in lecture, it is important that your code is properly indented as it greatly adds to readability. If you submit a code file that is not reasonably indented, you will have points deducted.
Likewise, you will lose points if your variable names are not meaningful. Make sure you use variable names that correspond to what you are storing in the variables.
Sample Output
As nothing is given in main, there’s no sample output to test against. Though feel free to add testing code to main as you progress.
Submission
You must push your code to the GitHub assignment to submit your solution.
Grading
We will be using a set of tests only available through GitHub Actions. You do not have access to our testing file. For questions about individual tests, please post on Piazza. The point breakdown is...
Item
Money class
Stock class
StockPortfolio class
Driver functions
Overall code quality
Total
Points
40
4
34
12
10
100
Page 2 of 2
- QQ:99515681
- 邮箱:99515681@qq.com
- 工作时间:8:00-21:00
- 微信:codinghelp
联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!