예제 #1
0
        static void Main(string[] args)
        {
            var account = new BankAccount();

            Console.WriteLine("How much is your deposit?");
            var amountToDeposit = double.Parse(Console.ReadLine());

            account.Deposit(amountToDeposit);
            account.GetBalance();
            Console.WriteLine($"Thank you! Your balance is now ${account.GetBalance()}");

            var    instance = new PersonalInformation();
            string number;
            long   result;

            do
            {
                Console.WriteLine("Please enter your phone number, area code first");
                number = Console.ReadLine();
            } while (number.Length != 10 || !long.TryParse(number, out result));

            instance.NumberFormatted = number;
            Console.WriteLine(instance.NumberFormatted);

            /*Console.WriteLine("Please enter your phone number, area code first");
             * instance.NumberFormatted = Console.ReadLine();
             * Console.WriteLine(instance.NumberFormatted);*/
        }
예제 #2
0
        static void Main(string[] args)
        {
            //var account = new BankAccount();

            //Console.WriteLine("How much would you like to deposit?");

            //var amountToDeposit = double.Parse(Console.ReadLine());

            //account.Deposit(amountToDeposit);

            //Console.WriteLine($"Thank you! Your balance is now {account.GetBalance()}");

            //var ryansInfo = new PersonalInformation();
            var    ryansInfo = new PersonalInformation();
            string number; // declare a variable
            long   results;

            do
            {
                Console.WriteLine("What is your area code and telephone number?");
                Console.WriteLine("with the following format: 2051235555");
                number = Console.ReadLine(); //store user input
            } while (number.Length != 10 || !long.TryParse(number, out results));

            ryansInfo.NumberFormatted = number;
            Console.WriteLine(ryansInfo.NumberFormatted);

            Console.WriteLine($"{ ryansInfo.NumberFormatted }");

            //Console.WriteLine("What is your phone number starting with the area code?");

            //ryansInfo.NumberFormatted = Console.ReadLine();

            //Console.WriteLine($"Your new phone number is {ryansInfo.NumberFormatted}");
        }
예제 #3
0
        static void Main(string[] args)
        {
            //Bank account

            var account = new BankAccount();

            Console.WriteLine("How much would you like to deposit?");

            var amountToDeposit = double.Parse(Console.ReadLine());

            account.Deposit(amountToDeposit);

            Console.WriteLine($"Thank you! Your balance is now {account.GetBalance()}");

            //Phone number

            var    accountInfo = new PersonalInformation();
            string number;
            long   result;

            do
            {
                Console.WriteLine("What is your phone number starting with the area code?");
                Console.WriteLine("With the following format: 8171231234");
                number = Console.ReadLine();
            } while (number.Length != 10 || !long.TryParse(number, out result));

            accountInfo.NumberFormatted = number;
            Console.WriteLine(accountInfo.NumberFormatted);


            // Console.WriteLine($" {accountInfo.NumberFormatted}");
        }
예제 #4
0
        static void Main(string[] args)
        {
            var kevinsAccount = new BankAccount();

            //Console.WriteLine("How much would you like to deposit?");

            //var amountToDeposit = double.Parse(Console.ReadLine());

            //account.Deposit(amountToDeposit);

            //Console.WriteLine($"Thank you! Your balance is now {account.GetBalance()}");

            var    kevinsInfo = new PersonalInformation();
            string number;
            long   result;

            do
            {
                Console.WriteLine("What is your phone number starting with the area code?");
                Console.WriteLine("with the following format: 1234567890");
                number = Console.ReadLine();
            } while (number.Length != 10 || !long.TryParse(number, out result));

            kevinsInfo.FormattedNumber = number;
            Console.WriteLine(kevinsInfo.FormattedNumber);

            Console.WriteLine($"Your new phone number is {kevinsInfo.FormattedNumber}");
        }
예제 #5
0
        static void Main(string[] args)
        {
            var CLSAccount = new BankAccount(10);

            CLSAccount.deposit(2273.32);

            Console.WriteLine(CLSAccount.getBalance());

            CLSAccount.Withdraw(200);

            var CLSAAccountInformation = new PersonalInformation();

            CLSAAccountInformation.PrintPersonalInfo();
        }
예제 #6
0
        static void Main(string[] args)
        {
            BankAccount Account1 = new BankAccount();

            Console.WriteLine("How much would you like to deposit into your account?");
            double depositAmount = Convert.ToDouble(Console.ReadLine());

            Account1.Deposit(depositAmount);
            double userBalance = Account1.GetBalance();

            Console.WriteLine($"Your balance is: {userBalance, 0:c}");
            Console.WriteLine();

            PersonalInformation Info = new PersonalInformation();

            Console.WriteLine("What is your phone number?");
            Info.NumberFormatted = (Console.ReadLine());
            Console.WriteLine($"Your phone number is {Info.NumberFormatted}");
        }
예제 #7
0
        static void Main(string[] args)
        {
            var bank = new BankAccount();

            Console.WriteLine($"Hello, how much would you like to deposit? Your current balance is {bank}");
            var amountToDeposit = double.Parse(Console.ReadLine());

            bank.Deposit(amountToDeposit);
            Console.WriteLine($"Your current balance is {bank.GetBalance()}");

            var    info = new PersonalInformation();
            string number;
            long   result;

            do
            {
                Console.WriteLine("What is your area code and telephone number?");
                Console.WriteLine("Using the formatting 000000000");
            }
        }
예제 #8
0
        static void Main(string[] args)
        {
            //In the main method of your application, create a new instance of
            //the BankAccount class.  Allow the user of the application to
            //Deposit money and retrieve their balance through the console.

            var yourAccount = new BankAccount();

            yourAccount.Deposit();

            yourAccount.GetBalance();


            //In the Main method, create an instance of the PersonalInformation
            //class and ask the user to input their phone number, then display
            //the newly formatted phone number(NumberFormatted) to the user

            var yourInfomation = new PersonalInformation();

            yourInfomation.KeyedInfomation();
        }
예제 #9
0
        static void Main(string[] args)
        {
            BankAccount userBankAccount = new BankAccount();

            Console.WriteLine("Please enter your name:");
            userBankAccount.name = Console.ReadLine();
            Console.WriteLine($"Hello, {userBankAccount.name} what can i assist you with today?");
            string[] options = { "Get Balance", "Make a deposit" };
            foreach (string choice in options)
            {
                Console.WriteLine(choice);
            }
            options[0] = "1";
            options[1] = "2";
            Console.WriteLine("Please select an option using 1 for get balance and 2 for deposit:");
            var custChoice = Console.ReadLine();

            if (custChoice == options[0])
            {
                Console.WriteLine(userBankAccount.GetBalance());
            }
            else if (custChoice == options[1])
            {
                Console.WriteLine("How much would you like to deposit?");
                var total = double.Parse(Console.ReadLine());
                userBankAccount.Deposit(total);
                Console.WriteLine($"After your deposit of {total}, your new balace is {userBankAccount.Balance}");
            }
            else
            {
                Console.WriteLine("Have a great day!");
            }
            Console.WriteLine("please enter your phone number:");
            PersonalInformation you = new PersonalInformation();

            you.NumberFormatted = Console.ReadLine();
            Console.WriteLine($"Please press enter if this phone number is correct: {you.NumberFormatted}.");
        }
예제 #10
0
        static void Main(string[] args)
        {
            var account = new BankAccount();

            Console.WriteLine(account.GetBalance());

            /*account.Deposit(300);
             * Console.WriteLine(account.GetBalance());*/

            var ppi = new PersonalInformation(); //Class constructor
            //var names = new List<string>(); //List constructor

            string number;
            long   result;

            do
            {
                Console.WriteLine("What is your area code and phone number?");
                number = Console.ReadLine();
            } while (number.Length != 10 || !long.TryParse(number, out result));

            ppi.NumberFormatted = number;
            Console.WriteLine($"{ppi.NumberFormatted }");
        }
예제 #11
0
        public static void Main(string[] args)
        {
/*TODO In the Main method, create an instance of the PersonalInformation class. */

            var NewPhoneWhoDis = new PersonalInformation();

/*TODO Ask the user to input their phone number. */

            Console.WriteLine("Enter your 10 digit phone number");
            NewPhoneWhoDis.NumberFormatted = Console.ReadLine();

/*TODO Display the newly formatted phone number to the user.*/

            Console.WriteLine($"{NewPhoneWhoDis.NumberFormatted} is your phone number");

/*TODO Create a new public class, "BankAccount.cs". */

/*TODO Create a new instance of "BankAccunt.cs". */

            var ba = new BankAccount();

/*TODO Create a new instance of the BankAccount class to pass through
 *     the GetBalance() Method. */

            var bb = ba.GetBalance();

/*TODO Show the user their current balance. */

            Console.WriteLine($" Your current balance is {bb} \nPlease, enter your deposit amount.");

/*TODO Allow the user to Deposit money and retrieve their
 *     balance through the console. Use the ".Parse()" method to convert type
 *     double to type string.*/

            var depAmount = double.Parse(Console.ReadLine());

/*TODO Take users input, store in variable, add to balance. */

            var ubalance = bb + depAmount;

/*TODO Write user's updated balance to the console. */

            Console.WriteLine($" Your new balance is {ubalance}.");

/*TODO Ask the user if they want to create a Savings Account and A Credit Card */

            Console.WriteLine($"Would you like to add a Savings Account?");

/* TODO Add the savings account and credit card as properties for the customer.
 * Looking for the parameter that correspods to the info */

            var addSavingsAccount = new PersonalInformation().SavingsAccount;
            var addCreditCard     = new PersonalInformation().CreditCard;


            var savResponse = Console.ReadLine();

            switch (savResponse.ToLower())
            {
            case "yes":     // is adding savings

/*TODO nest switch statements to accomodate user input */

                Console.WriteLine("Great! Your info has been added." +
                                  "Would you like to apply for a credit card?"); // asking to add credit card

                var ccResponse = Console.ReadLine();
                switch (ccResponse.ToLower())
                {
                case "yes":
                    Console.WriteLine("Great! Your info has been added. Thank you, have a nice day!");         // confirmation credit card added.
                    break;

                case "no":
                    Console.WriteLine("Ok, maybe another time, take care!");         // confirmation credit card not added.
                    break;

                case null:
                    Console.WriteLine("It's never to early to build your credit!");
                    break;
                }

                break;

            case "no":
                Console.WriteLine("Ok, would you like to apply for a credit card?");

                var ccResponse2 = Console.ReadLine();

                switch (ccResponse2.ToLower())
                {
                case "yes":
                    Console.WriteLine("Great! Your info has been added. Thank you, have a nice day!");         // confirmation credit card added.
                    break;

                case "no":
                    Console.WriteLine("Ok, maybe another time, take care!");         // confirmation credit card not added.
                    break;

                case null:
                    Console.WriteLine("It's never to early to build your credit!");
                    break;
                }
                break;

            case null:
                Console.WriteLine("It's never to early to start saving!");
                break;
            }
        }