© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
28 replies
Moha

Bank program help

using System;

class Bank
{
    static void Main()
    {
        Console.WriteLine("Welcome to the bank. Please select one of the given options.");
        Console.WriteLine("1. Withdraw money");
        Console.WriteLine("2. Deposit money");
        Console.WriteLine("3. Check balance");
        Console.WriteLine("4. Send money");

        int balance = 0;
        int option = int.Parse(Console.ReadLine());

        while (option >= 5)
        {
            Console.WriteLine("Please choose a valid option.");
            option = int.Parse(Console.ReadLine());
        }

        if (option == 1)
        {
            Console.WriteLine("Please write the amount of money you are gonna withdraw.");
            int amount = int.Parse(Console.ReadLine());
            Console.WriteLine("Withdrawing " + amount + "...");

            balance -= amount;

            Console.WriteLine("Your new balance is " + balance + ".");
        }

        if (option == 2)
        {
            Console.WriteLine("Please write the amount of money you are gonna deposit.");
            int amount = int.Parse(Console.ReadLine());
            Console.WriteLine("Depositing " + amount + "...");

            balance += amount;

            Console.WriteLine("Your new balance is " + balance + ".");
        }




    }
}
using System;

class Bank
{
    static void Main()
    {
        Console.WriteLine("Welcome to the bank. Please select one of the given options.");
        Console.WriteLine("1. Withdraw money");
        Console.WriteLine("2. Deposit money");
        Console.WriteLine("3. Check balance");
        Console.WriteLine("4. Send money");

        int balance = 0;
        int option = int.Parse(Console.ReadLine());

        while (option >= 5)
        {
            Console.WriteLine("Please choose a valid option.");
            option = int.Parse(Console.ReadLine());
        }

        if (option == 1)
        {
            Console.WriteLine("Please write the amount of money you are gonna withdraw.");
            int amount = int.Parse(Console.ReadLine());
            Console.WriteLine("Withdrawing " + amount + "...");

            balance -= amount;

            Console.WriteLine("Your new balance is " + balance + ".");
        }

        if (option == 2)
        {
            Console.WriteLine("Please write the amount of money you are gonna deposit.");
            int amount = int.Parse(Console.ReadLine());
            Console.WriteLine("Depositing " + amount + "...");

            balance += amount;

            Console.WriteLine("Your new balance is " + balance + ".");
        }




    }
}

Now here what I'm asking is if I want to do an "Would you like to do any other missions?" Would I put it inside the if or outside the if?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Simple Bank program, DataGridView issue
C#CC# / help
13mo ago
Bank code
C#CC# / help
12mo ago
Help with program structure.
C#CC# / help
3y ago
Help with program logic
C#CC# / help
3y ago