Assignment5 (7).java - import java.io import java.util/to...

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

import java.io.*; //to use InputStreamReader and BufferedReader import java.util.*; //to use ArrayList public class Assignment5 extends SummerCamp { public Assignment5 (String a, String b, double c, int d) { super(a,b,c,d); } public static void main (String[] args) { char input1; String inputInfo = new String(); String line = new String(); boolean operation; // ArrayList object is used to store SummerCamp objects ArrayList summerCampList = new ArrayList(); try { printMenu(); // print out menu // create a BufferedReader object to read input from a keyboard InputStreamReader isr = new InputStreamReader (System.in); BufferedReader stdin = new BufferedReader (isr); do { System.out.println("What action would you like to perform?"); line = stdin.readLine().trim(); input1 = line.charAt(0); input1 = Character.toUpperCase(input1); if (line.length() == 1) { switch (input1) { case 'A': //Add SummerCamp System.out.print("Please enter some summer camp information to add:\n"); inputInfo = stdin.readLine().trim(); summerCampList.add(SummerCampParserClass.parseStringToSummerCamp(inputInfo)); break; case 'C':

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture