Results 1 to 4 of 4
Thread: Problem design issue
- 10-24-2011, 05:16 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 18
- Rep Power
- 0
Problem design issue
I am rather unsure as to how to go about starting this problem so here goes:
1. I need to design and develop a Java package that can analyze arbitrary-sized Bliffoscope images,
returning a list of targets found. Each target found should include the target type
found (starship or slime torpedo), the coordinates of the target on the Bliffoscope data,
and some indication of your confidence in the target detection.
2. Design and write test code that submits the test data to your package and prints the
results returned by your package.
So far I have written code to load in the attached files to create a 2d array as shown below:
How do I go about matching the 2d char array of both the slime torpedo and starships to the data within the test file?Java Code:import java.io.*; import java.util.*; public class SlimeTorpedo { public static void main(String[]args) { File file = new File("SlimeTorpedo.txt"); ArrayList<String> arrayList = new ArrayList<String>(); try { //reads each line from the text file and places it into a string array BufferedReader br = new BufferedReader(new FileReader(file)); String str; while ((str = br.readLine()) != null) { arrayList.add(str); } //creates a stringFormat array and places the strings in the array list onto the stringFormat array String stringFormat[] = new String[arrayList.size()]; arrayList.toArray(stringFormat); //creates 2d char array and writes the characters from the stringFormat array onto the 2d char array char charFormat[][] = new char[stringFormat.length][]; for (int i = 0; i < stringFormat.length; i++) { charFormat[i] = stringFormat[i].toCharArray(); } //for testing purposes, prints the 2d charFormat array for (int i = 0; i < stringFormat.length; i++) { for (int j = 0; j < charFormat[i].length; j++) { System.out.print(charFormat[i][j]); } System.out.println(""); } } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } }
- 03-23-2012, 07:40 PM #2
Member
- Join Date
- Mar 2012
- Posts
- 1
- Rep Power
- 0
Re: Problem design issue
I am new to this forum and was generally browsing and saw this question. This is an interesting problem. Were you able to solve it?
- 10-26-2012, 07:39 PM #3
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Re: Problem design issue
did you already find answers for this? it is interesting one..if you find the answers, could you pls share to me or in this forum?
- 10-26-2012, 09:11 PM #4
Similar Threads
-
Overriding methods - design problem
By viking90 in forum New To JavaReplies: 1Last Post: 03-23-2011, 09:13 PM -
Design Problem
By crystalClear in forum Advanced JavaReplies: 3Last Post: 02-09-2011, 12:02 PM -
Netbeans 6.8 GUI design problem
By newbiejava in forum NetBeansReplies: 0Last Post: 01-14-2010, 02:02 AM -
Java Design Problem
By hencre in forum Advanced JavaReplies: 2Last Post: 02-25-2009, 07:08 AM -
Design Issue
By naveenmails in forum Advanced JavaReplies: 3Last Post: 07-29-2008, 03:32 PM


LinkBack URL
About LinkBacks

Bookmarks