Assignment8 - / Assignment #: / Name: / StudentID: /...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
// Assignment #: 8 // Name: Daniel Sauter // StudentID: 1202351076 // Lecture: MWF: 2:00pm - 2:50pm // Description: The Assignment 8 class displays a menu of choices to a user // and performs the chosen task. It will keep asking a user to // enter the next choice until the choice of 'Q' (Quit) is // entered. It will create an object of BankSystem containing a list // of banks and customers, and perform insertion, deletion, // search, sorting, displaying, closing, writing to a file, // and reading from a file. import*; public class Assignment8 { public static void main (String[] args) { char input1; String inputInfo = new String(), inputInfo2 = new String(); String inputInfo3 = new String(), inputInfo4 = new String(); boolean operation = false; int operation2 = 0; int bankID; String line = new String(); String customerInfo = new String(), bankInfo = new String(); String filename = new String(); // create a BankSystem object. This is used throughout this class. BankSystem bankSystem1 = new BankSystem(); try { // print out the menu printMenu(); // create a BufferedReader object to read input from a keyboard InputStreamReader isr = new InputStreamReader (; BufferedReader stdin = new BufferedReader (isr); do { System.out.print("What action would you like to perform?\n"); line = stdin.readLine().trim(); //read a line input1 = line.charAt(0); input1 = Character.toUpperCase(input1); if (line.length() == 1) //check if a user entered only one character { switch (input1) { case 'A': //Add Customer System.out.print("Please enter the customer information to add:\n"); inputInfo = stdin.readLine().trim(); / *********************************************************************************** * *** ADD your code to add a Customer object
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
*********************************************************************************** / if (operation == true) System.out.print("customer added\n"); else System.out.print("customer exists\n"); break; case 'B': //Add Bank System.out.print("Please enter the bank information to add:\n"); inputInfo = stdin.readLine().trim(); / *********************************************************************************** * *** ADD your code to add a Bank object
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/22/2010 for the course BSE 71920 taught by Professor Nakurmura during the Spring '10 term at ASU.

Page1 / 5

Assignment8 - / Assignment #: / Name: / StudentID: /...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online