Breaking News

Tuesday, 17 July 2018

bank program in c#

Image result for program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tut2
{
    class BankSolution
    {
      static  int bal = 10000;
        string username = "RKU";
        int acnt_no = 12345;

        public static void check_bal()
        {
            Console.WriteLine("your balance is: " + bal);
        }

        public static void credit()
        {
            Console.WriteLine("enter the amout to deposit:");
            int amt = int.Parse( Console.ReadLine());
            bal += amt;
            check_bal();
        }

        public static void debit()
        {
            Console.WriteLine("enter the amount to debit");
            int amt = int.Parse(Console.ReadLine());
            bal -= amt;
            check_bal();
        }


    }
}






main




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tut2
{
    class Program
    {
        static void Main(string[] args)
        {
            int ch;
            bool temp = true;

            while (temp)
            {
                Console.WriteLine("enter your choice\n1. check balance\n 2. credit \n 3. debit");
                ch = int.Parse(Console.ReadLine());

                switch (ch)
                {
                    case 1:
                        BankSolution.check_bal();
                        break;
                    case 2:
                        BankSolution.credit();
                        break;
                    case 3:
                        BankSolution.debit();
                        break;
                    default:
                        break;
                }

                Console.WriteLine("for cont. press 1 else 0");
                int x = int.Parse(Console.ReadLine());
                if (x!=1)
                {
                    temp = false;
                }

            }
        }
    }
}

output:-


2 comments:

  1. Studing the complete development lifecycle & analasis various activites
    conducted as a part of various faces for each sdlc face identifies the objectivtes
    & summeriaes the outcomes.

    ReplyDelete
  2. Hello all
    am looking few years that some guys comes into the market
    they called themselves hacker, carder or spammer they rip the
    peoples with different ways and it’s a badly impact to real hacker
    now situation is that peoples doesn’t believe that real hackers and carder scammer exists.
    Anyone want to make deal with me any type am available but first
    I‘ll show the proof that am real then make a deal like

    Available Services

    ..Wire Bank Transfer all over the world

    ..Western Union Transfer all over the world

    ..Credit Cards (USA, UK, AUS, CAN, NZ)

    ..School Grade upgrade / remove Records

    ..Spamming Tool

    ..keyloggers / rats

    ..Social Media recovery

    .. Teaching Hacking / spamming / carding (1/2 hours course)

    discount for re-seller

    Contact: 24/7

    fixitrogers@gmail.com

    ReplyDelete