User Profile

Collapse

Profile Sidebar

Collapse
JinFTW
JinFTW
Last Activity: Sep 23 '08, 09:12 PM
Joined: Feb 26 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • JinFTW
    replied to Ordered arrays
    in Java
    Ah thank you for the advice, I reworked the insert code and I've come up with this, but now I can't get it to compile at all.

    Code:
    public void insert (int x, int y, int value)		// puts element into array
          {
             int i;														
             int j;
    			int a;
    			int b;
    			for (i = 0; i < nElems; i++)			// finds where it goes
        			for (j = 0; j < nElems; j++)
    ...
    See more | Go to post

    Leave a comment:


  • JinFTW
    started a topic Ordered arrays
    in Java

    Ordered arrays

    Hey guys I hate to bother you with another question so soon, but I've set up a 2d ordered array, and while my delete and search methods work okay, my display/insertion methods have to be missing something, or perhaps I've used too much information. Don't get me wrong, the 2d array in my driver is in ascending order like it should be, but the elements are not in the right coordinates. The only one that is placed right is 0,0. Everything else just...
    See more | Go to post

  • JinFTW
    replied to Question about 2d arrays
    in Java
    Thank you very much, that helped a lot!
    See more | Go to post

    Leave a comment:


  • JinFTW
    started a topic Question about 2d arrays
    in Java

    Question about 2d arrays

    Hey guys, I hate to bother you all, but I had a HW assignment last week that I couldn't get no matter what values (variables) I tried and according to my professor, it's too easy to have to go over in class (I don't think so), so even though I failed the homework, I have no idea on "the right way to do it" and I'm worried that I might be faced with a similar problem on the test in October. Any help in assisting me with the search and delete...
    See more | Go to post

  • LinearSearch in Java with two of the same object (type).

    Hey guys I was just curious as to how (if) you could use linearsearch to find two of the same item in an array. For example:

    Code:
    public static Comparable linearSearch (Comparable[] list, Comparable target)
       {
          int index = 0;
          boolean found = false;
    
          while (!found && index < list.length)
          {
             if (list[index].equals(target))
                found
    ...
    See more | Go to post

  • JinFTW
    started a topic Question about ArrayList and Jbuttons
    in Java

    Question about ArrayList and Jbuttons

    Hey guys I hate to bother you with this, but I'm having a problem with creating an arrayList of JButtons that will end up using an actionlistener. My original program was this:

    Code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    
    
    public class KeyBorderPanel extends JPanel
    {
    	private JLabel resultLabel;
    	private JButton
    ...
    See more | Go to post

  • JinFTW
    started a topic Program Question (arrays)
    in Java

    Program Question (arrays)

    Ok so I had to develop a class in which I needed to count the number of times someone enters in a number from a selected group of numbers from 1 to 100. In this case we're talking about groups of 10. Since I'm not very good with arrays (it was advised I use an array of counters, but since my professor has yet to teach us do so, that wouldn't really work anyway). So I decided to get creative and do it this way (not finished yet, only worked up to...
    See more | Go to post

  • Ok after adding list[number]++;
    and looking at the problem itself, it appears as though I'm only taking in one value from the user. I hate to bother you guys with this, but I suppose I have another question here, do I need another for loop in this statement? Or am I supposed to use an if-else in order to have this thing read the user's answers again and again?
    See more | Go to post

    Leave a comment:


  • Thank you so much! I think I can see where it's going now, much appreciated to you for clearing that up!
    See more | Go to post

    Leave a comment:


  • I'm simply wondering how you use an array to give the number of occurrences for each integer that the user enters.
    See more | Go to post

    Leave a comment:


  • This is how far I've gotten, I realize there are a number of mistakes, but I'm currently working on it.


    [CODE=Java]import java.util.Scann er;
    public class Numbers
    {
    public static void main (String[] args)
    {
    Scanner scan = new Scanner (System.in);
    final int MAXNUM = 51;
    int[] list = new int [MAXNUM];

    int current=0;

    System.out.prin tln...
    See more | Go to post
    Last edited by BigDaddyLH; Feb 26 '08, 09:25 PM. Reason: added code tags

    Leave a comment:


  • An application that reads numbers in the range of 0 to 50

    I'm trying to create an application that reads an arbitrary number of integers that are in the range 0 to 50 and counts how many occurrences of each are entered. At the end of the input processing, I have to print all of the values (including number of occurrences) that were used one or more times.

    So far I've set up the scanner, and I had originally thought to use a number of scan.nextInt() in order to calculate each and every one,...
    See more | Go to post
No activity results to display
Show More
Working...