Assignment5.java - import java.io import java.util public...

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

import java.io.*;import java.util.*;public class Assignment5 {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 objectsArrayList<SummerCamp> summerCampList = new ArrayList<SummerCamp>();try {printMenu(); // print out menu// create a BufferedReader object to read input from a keyboardInputStreamReader 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 SummerCampSystem.out.print("Please enter some summer camp information to add:\n");inputInfo = stdin.readLine().trim();summerCampList.add(SummerCampParser.parseStringToSummerCamp(inputInfo));break;case 'C': //Compute Total Costs for all campsfor (int i = 0; i < summerCampList.size(); i++) {summerCampList.get(i).computeTotalCosts();}

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture