Giter Site home page Giter Site logo

bankmaster.java's Introduction

BANKMASTER.java

import java.util.Scanner;

public class BankMaster {

public static void main(String[] args) 

{

	Scanner input = new Scanner(System.in);
	int sentinal = 0;
	int size = 0;
	double[] accountBalences = new double[250];
	String[] accountNames = new String[250];
	while(sentinal != -1)
{
		
		System.out.println("Bank Admin Menu");
		System.out.println("Please Enter a Menu Option");
		System.out.println("(1): Add Customer to Bank");
		System.out.println("(2): Change Customer Name");
		System.out.println("(3): Check Account Balence");
		System.out.println("(4): Modify Account Balence");
		System.out.println("(5): Summary of All Accounts");
		System.out.println("(-1): Quit");
		
		int userInput = input.nextInt();
		if(userInput == 1){
			System.out.println("Bank Add Customer Menu");
			System.out.println("Please Enter an account balence");
			double balence = input.nextDouble();
			accountBalences[size] = balence;
			System.out.println("Please enter an account holder name: ");
			input.nextLine();
			String name = input.nextLine();
			accountNames[size] = name;
			System.out.println("Customer's ID is :" + size);
			size = size + 1;
		}
		else if(userInput == 2){
			System.out.println("Bank Change Name Menu");
			System.out.println("Please Enter a customer ID to change their name");
			int index = input.nextInt();
			System.out.println("What is the customer's new name?");
			input.nextLine();
			accountNames[index] = input.nextLine();
		}
		else if(userInput == 3){
			System.out.println("Bank Check Balence Menu");
			System.out.println("Please Enter a customer ID to check their balence");
			int index = input.nextInt();
			double balence = accountBalences[index];
			System.out.println("This customer has $" + balence + " in their account");
		}
		else if(userInput == 4){
			System.out.println("Bank Modify Balence Menu");
			System.out.println("Please Enter a customer ID to check their balence");
			int index = input.nextInt();
			System.out.println("What is the customer's new account balence");
			accountBalences[index] = input.nextDouble();
		}
		else if(userInput == 5){
			System.out.println("Bank All Customer Summary Menu");
			double total = 0;
			for(int i = 0; i < size; i++){
				total = total + accountBalences[i];
				System.out.println(accountNames[i] + " has $" + accountBalences[i] + " in their account");
			}
			System.out.println("In total, there is $" + total + " in the bank");
		}
		else if(userInput == -1){
			System.exit(-1);
		}
		else{
			System.out.println("Error: Invalid input entered");
		}
	}
}

}

bankmaster.java's People

Contributors

anishkumar1253 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.