User Profile

Collapse

Profile Sidebar

Collapse
NycCraze88
NycCraze88
Last Activity: Oct 29 '08, 06:57 PM
Joined: Dec 16 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • NycCraze88
    replied to Why wont Test 1 and Test 2 resolve?
    in Java
    Yes I solved the problem and everything works fine.....the only problem Im confused about is when i compile and run the program...its supposed to print out "Enter Marys score for test 1" but instead it says "Enter null's score for test 1"...I dont understand why its replacing the name with null....its nothing serious I suppose but I would like to know how to fix it...here's my updated code:

    Code:
    public class
    ...
    See more | Go to post

    Leave a comment:


  • NycCraze88
    started a topic Why wont Test 1 and Test 2 resolve?
    in Java

    Why wont Test 1 and Test 2 resolve?

    Working on some basic code and I dont get why Test 1 and Test 2 wont resolve when I call the getAverage function in the main method....here are my classes, can someone please tell me what the problem is? Or point me in the right direction?

    Code:
    import java.util.Scanner;
    public class Student
    {
        Scanner input = new Scanner(System.in);
        // declare instance data 
        private String studentName;
    ...
    See more | Go to post
    Last edited by JosAH; Oct 27 '08, 07:33 PM. Reason: added [code] ... [/code] tags

  • NycCraze88
    replied to Im getting this stupid error...
    in Java
    I solved the problem. thanks anyway, you guys can delete this thread.
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Im getting this stupid error...
    in Java
    its supposed to use the formula that verifies if the check digit is correct on the inputted number......the formula is:


    14
    Sigma 10^(14-i) X Ai = A15 mod 7
    i=1

    i can post the whole code if you want..
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Im getting this stupid error...
    in Java
    anybody? This error is really pissing me off
    See more | Go to post

    Leave a comment:


  • NycCraze88
    started a topic Im getting this stupid error...
    in Java

    Im getting this stupid error...

    Im wondering what I need to do to fix this problem....here 's the piece of code:

    private static int checkDigits(Str ing choice2) {
    char[] chars = String.valueOf( choice2).toChar Array();
    int check = 0;
    for (int j = 0; j < chars.length; j++)
    check += Integer.parseIn t(String.valueO f((int)pow(10, 14-j)*chars[j]));
    int digit = Integer.parseIn t(String.valueO f(chars[14]));
    ...
    See more | Go to post

  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    The logic of the comparator is exactly the way you said it should be isnt it? it first compares the radius, if equal, then compare the green color components and so forth. I took out the Sort circle method, but i still get an error in the main. How can I fix this error?
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    Here is my entire code. The thing looks fine, but I get a small error all the way down below in the main, where it says Collections.sor t(circles, circleComp) (I've bolded and underlined where Eclipse gives me the error warning). The error reads: "The method sort(List<T>, Comparator<? super T>) in the type Collections is not applicable for the arguments (ArrayList<Circ le>, SortCircle)"

    I dont know how to...
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    If someone can IM me on BiG DoGG 536, this could go by alot quicker.
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    Nvm, I figured out how to incorporate it, I just need help with getting the sort to run in the main. How would I do that
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    Ok, but how would I incorporate that to my comparator? (I'm really bad at this lol)
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    I keep getting this error "Cannot invoke compateTo(int) on the primitive type int" when Im trying to compare the colors. How do I fix that. I also need to know how to implement the sort in the main.
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    Im still getting errors. Im trying to understand why this class wont extend the circle class (which contains the methods I need such as getRadius(), etc in order for me to be able to sort. Here's what I have so far..

    Code:
    package trials;
    
    import java.awt.Color;
    import java.awt.Point;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Comparator;
    
    public class
    ...
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    The code above is a big help, thanks dude.

    Im off to class now but when Im back, I'll continue working on the code and i'll come back here if I need anymore help. Thanks everyone.
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    Since I have to sort the circles in order ( By Radius first, if radius's are equal, sort by the green color component of the circles, if both greens are equal, then sort by the blue component and so forth) should I use nested If statements with sorts in each, or should I do something different?
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    Well he said we could build our own sort programs or use something built into the java libraries to do the sorts...


    But anyway, I built one of my own that sorts the circle array....but Im not really sure how to adapt it so that it sorts the circles by radius, then by the green color component, then the blue, then red. I understand you're supposed to used comparators, just not sure how to do it.

    Here's my circle...
    See more | Go to post

    Leave a comment:


  • NycCraze88
    replied to Circle Sorting Help!!
    in Java
    I'm not perfect with them but I think I can pull it off. What do you suggest?
    See more | Go to post

    Leave a comment:


  • NycCraze88
    started a topic Circle Sorting Help!!
    in Java

    Circle Sorting Help!!

    Hey all,

    I'm in a Java data structures class in college and I have a problem with this one sorting assignment. I'm not very experienced in java and have tried tackling this assignment in an assortment of ways but have failed miserably. Basically, here is the assignment:::

    =============== =============== =============== ===========
    "If you look in http://csis.pace.edu/~bergin/temp/circles.zip ...
    See more | Go to post
No activity results to display
Show More
Working...