Assignment4.java - import java.util.Scanner public class...

This preview shows page 1 - 2 out of 2 pages.

import java.util.Scanner; public class Assignment4 { public static void main (String[] args) { // local variables, can be accessed anywhere from the main method char input1 = 'Z'; String inputInfo; String bankName; int bankID; String city; String state; String line = new String(); // instantiate a Bank object Bank bank1 = new Bank(); printMenu(); //Create a Scanner object to read user input Scanner scan = new Scanner(System.in); do // will ask for user input { System.out.print("What action would you like to perform?\n"); line = scan.nextLine(); if (line.length() == 1) { input1 = line.charAt(0); input1 = Character.toUpperCase(input1); // matches one of the case statement switch (input1) { case 'A': //Add Bank System.out.print("Please enter the bank information:\n"); System.out.print("Enter a bank name:\n"); bankName = scan.nextLine(); bank1.setBankName(bankName); System.out.print("Enter a bank ID:\n");

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture