コード例 #1
0
ファイル: Program.cs プロジェクト: ribex/OOP
 public Portfolio(double cash, double stocks, double bonds, double mutualFunds)
 {
     this.cash        = new Cash(cash);
     this.stocks      = new Stocks(stocks);
     this.bonds       = new Bonds(bonds);
     this.mutualFunds = new MutualFunds(mutualFunds);
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: ribex/OOP
        static void Main(string[] args)
        {
            var myCash        = new Cash(121.36);
            var myStocks      = new Stocks(2342.87);
            var myBonds       = new Bonds(3212.03);
            var myMutualFunds = new MutualFunds(4321.45);
            var myPortfolio   = new Portfolio();

            Console.WriteLine("Total Portfolio Balance: " + myPortfolio.TotalBalance(myCash.CashBalance, myStocks.StocksBalance, myBonds.BondsBalance, myMutualFunds.MutualFundsBalance));
        }