Question: please help me fill the code of assignment5. import java.io.*; //to use InputStreamReader and BufferedReader import java.util.*; //to use ArrayList public class Assignment5 { public

 please help me fill the code of assignment5. import java.io.*; //touse InputStreamReader and BufferedReader import java.util.*; //to use ArrayList public class Assignment5{ public static void main (String[] args) { char input1; String inputInfo= new String(); String line = new String(); boolean operation; // ArrayListobject is used to store lamp objects ArrayList lampList = new ArrayList();try { printMenu(); // print out menu // create a BufferedReader objectto read input from a keyboard InputStreamReader isr = new InputStreamReader (System.in);BufferedReader stdin = new BufferedReader (isr); do { System.out.println("What action would you

please help me fill the code of assignment5.

import java.io.*; //to use InputStreamReader and BufferedReader import java.util.*; //to use ArrayList

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 lamp objects ArrayList lampList = 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 Lamp System.out.print("Please enter a lamp information to add: "); inputInfo = stdin.readLine().trim(); /*********************************************************************************** *** ADD your code here to create an object of one of child classes of Lamp class *** and add it to the lampList ***********************************************************************************/ Lamp lamp = LampParser.parseStringToLamp(inputInfo); lampList.add(lamp); break; case 'C': //Compute Total Prices /*********************************************************************************** *** ADD your code here to compute the total price for each lamp in the lampList. ***********************************************************************************/ for(int i =0; i

/** The method printMenu displays the menu to a use **/ public static void printMenu() { System.out.print("Choice\t\tAction " + "------\t\t------ " + "A\t\tAdd Lamp " + "C\t\tCompute Total Prices " + "D\t\tSearch for Lamp " + "L\t\tList Lamps " + "Q\t\tQuit " + "?\t\tDisplay Help "); } }

Minimal Submitted Files You are required, but not limited, to turn in the following source files: Assignment5.java (Download this file and use it as your driver program for this assignment. You need to add more codes to complete it.) Lamp.java FluorescentLamp.java LEDLamp.java LampParser.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!