Application - package code2; i import java.util.Scanner; p...

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

View Full Document Right Arrow Icon
package code2; import java.util.Scanner; i public class Application { p public static void main(String[] args) { p List aList = new List(); Menu aMenu = new Menu(); aMenu.readFile(aList, "victim.txt"); System.out.println("Disaster Management System"+"\n"+"Select an option:"); System.out.println("1. Add Structure"+"\n"+"2. Edit Structure"+"\n"+"3. Seach"+"\n"+"4. Sort(ID)"+"\n"+"5. Sort(Priority)"+"\n"+"6. Exit"); Scanner console = new Scanner(System.in); int choice = console.nextInt(); aMenu.menuDriver(aList, choice); a } } /**public void readFile(List someList, String someString) { FileRead fr = new FileRead(someString); line = fr.readLine(); while(line!=null) { tokens = line.split(","); if(tokens[6]==null) { Structure tempStructure = new Structure(new Id(tokens[0]), tokens[1], tokens[2], Double.parseDouble(tokens[3]), Integer.parseInt(tokens[4]), tokens[5]); someList.insert(tempStructure); } else if(tokens[7]==null) { Destroyed tempDestroyed = new Destroyed(Integer.parseInt(tokens[6]));
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Application - package code2; i import java.util.Scanner; p...

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

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