Question: I want to translate this into code java language private Random randy; There is a modelPortfolio method with a single input with the number of
I want to translate this into code java language
private Random randy;
There is a modelPortfolio method with a single input with the number of months to model.
For each month
For each investment in the portfolioInvestments ArrayList
If a Stock
Every three months (quarterly)
Randomly generate a type double price change of between -10% and +20% (Use global randy)
Randomly generate a type double dividendPercent between 0 and 5% (Use global randy)
Call calcStockValues for this Stock with appropriate parameters
ElseIf a Bond
Call calcBondValues() for this Bond
ElseIf a SavingsAccount
Do 3 times (3 transactions per month)
Generate a deposit or withdrawal between -$600.00 and $1000.00 (Use global randy)
If deposit (positive number)
Call makeDeposit for this SavingsAccount with appropriate parameter
If withdrawal (positive number)
Call makeWithdrawal for this SavingsAccount with appropriate parameter
Call calcValue for this SavingsAccount
ElseIf a CheckingAccount
Generate a deposit between $500.00 and $1500.00 (Use global randy)
Call makeDeposit for this CheckingAccount with appropriate parameter
Do 4 times per month (writing 4 checks)
Generate a check between $10.00 and $300.00 (Use global randy)
Call writeCheck for this CheckingAccount with appropriate parameter
Call calcValue for this SavingsAccount (This done once at end of month to calculate interest, if any)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
