Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Assignment2_4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int choice;
- string[] name = new string[2];
- name[0]="User";
- name[1]="User1";
- name[2]="User2";
- BankAccount User = new BankAccount();
- BankAccount User1 = new BankAccount();
- BankAccount User2 = new BankAccount();
- User.BankAccountConstruct();
- User1.BankAccountConstruct();
- User2.BankAccountConstruct();
- Console.WriteLine("Which account do you want to manipulate with?(0/1/2");
- choice = int.Parse(Console.ReadLine());
- bool wdcontinue=true;
- string check="";
- while (wdcontinue==true)
- {
- bool truth = false;
- while (truth == false)
- {
- Console.WriteLine("Do you want to deposit or withdraw money?(d/w)");
- check=Console.ReadLine();
- if (check == "d" || check == "w")
- { truth = true; }
- else
- { Console.WriteLine("You have selected invalid option"); }
- }
- if (check == "d")
- {
- Console.WriteLine("How much do you want to deposit?");
- decimal deposit = Convert.ToDecimal(Console.ReadLine());
- name[choice].Deposit(deposit);
- }
- else if (check=="w")
- {
- Console.WriteLine("How much do you want to withdraw?");
- decimal deposit = Convert.ToDecimal(Console.ReadLine());
- name[choice].WithDraw(deposit);
- }
- User.ShowInfo();
- string answer = "";
- bool inputyn = false;
- while (inputyn == false)
- {
- Console.WriteLine("Do you whish to continue?(y/n)");
- answer = Console.ReadLine();
- if (answer == "n") { wdcontinue = false; inputyn = true; }
- else if (answer == "y") { wdcontinue = true; inputyn = true; }
- else
- {
- Console.WriteLine("bad answer");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement