Приставка.строку не работает,
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Lab4 { class Program { static void Main(string[] args) { SavingAccount aSavingAccount; List<savingaccount> accounts = new List<savingaccount>(); while (true) { Console.Write("Please enter the account owner's name: "); string Owner = Console.ReadLine(); if (Owner == "") break; Console.Write("Please enter the initial deposit amount for the saving account: "); string entry1 = Console.ReadLine(); double InitialDepositAmount = double.Parse(entry1); Console.Write("Please enter the monthly deposit amount for the saving account: "); string entry2 = Console.ReadLine(); double MonthlyDepositAmount = double.Parse(entry2); aSavingAccount = new SavingAccount(Owner, InitialDepositAmount); aSavingAccount.MonthlyDepositAmount = MonthlyDepositAmount; accounts.Add(aSavingAccount); } foreach (SavingAccount account in accounts) { for(int i = 0; i < 6; i++) { account.Withdraw(SavingAccount.MonthlyFee); account.Deposit(account.MonthlyDepositAmount); account.Deposit(SavingAccount.MonthlyInterestRate * account.Balance); } Console.WriteLine("After 6 months, {0}'s account (#{1}), has a balance of: {2:C}", account.Owner, account.AccountNumber, account.Balance); } } }
Что я уже пробовал:
Я попытался запустить в другом окне visual studio, но он показывает все ошибки красной строки для полного кода строки
CHill60
Что вы подразумеваете под "не работает"? Если ваш код показывает все красные линии, то у вас есть ошибки компиляции - найдите их и исправьте