Search:

Type: Posts; User: Java Neil

Page 1 of 3 1 2 3

Search: Search took 0.27 seconds.

  1. Replies
    5
    Views
    1,206

    Re: ReadWrite program advise

    I'm almost there. I decided to use my own class to sort but it's not working. It might be the placement.

    Take a look...

    import java.util.Random;
    import java.io.*;

    public...
  2. Replies
    5
    Views
    1,206

    Re: ReadWrite program advise

    Well I corrected my code to print and write 100 integers. On the other hand I'm completely stumped about how to sort it. Help me please!

    Do I need an array? Where should that code go if I do? If...
  3. Replies
    5
    Views
    1,206

    ReadWrite program advise

    Hi all...I have this program that I wrote that creates a random number, writes it to a file and scans it back to the system. That part alone took me forever to hash out. Now I stuck. I would like to...
  4. Replies
    17
    Views
    1,460

    Re: New to Objects...

    Check me...

    I have two codes that both work. One code based off of the example in my book, and the example you gave me.

    Book example:
    import javax.swing.JOptionPane;
    public class...
  5. Replies
    17
    Views
    1,460

    Re: New to Objects...

    Now see...That was very helpful! Thanks for setting up the form.

    I'll get it. I just started objects. No need to doom me before I apply the concepts.
  6. Replies
    17
    Views
    1,460

    Re: New to Objects...

    OK, I don't understand. As I said I work better with "seeing the logic" rather than being told. Never built an object . No nothing of how constructors work. You're naming parts of an object that I...
  7. Replies
    17
    Views
    1,460

    Re: New to Objects...

    Like I said before. My teacher has only covered about 30 minutes worth of material for the last part of the last class. I have not grasped the material fully yet.

    I applied you code suggestion...
  8. Replies
    17
    Views
    1,460

    Re: New to Objects...

    OK, I changed the variables to just public.

    import javax.swing.*;

    public class TestRectangle {

    public static void main (String[] args) {

    Rectangle rectangle1...
  9. Replies
    17
    Views
    1,460

    Re: New to Objects...

    Well after about 3 hours, I need some help with something I haven't learned yet.

    Here is my first attempt at this program. My main goal was just to have it compile and show me the fields.

    ...
  10. Replies
    17
    Views
    1,460

    Re: New to Objects...

    For my hardest assignment in this chapter I am supposed to create a "class Rectangle" to represent a rectangle. The class needs to have the following...

    1. Two double data fields named width and...
  11. Replies
    17
    Views
    1,460

    Re: New to Objects...

    They are just strings for input.

    Here is the corrected code

    class code
    public class Employee {
    private String fname;
    private String lname;
    private String id;
    private...
  12. Replies
    17
    Views
    1,460

    Re: New to Objects...

    OK, I see what you mean.

    I feel kinda dumb.
  13. Replies
    17
    Views
    1,460

    Re: New to Objects...

    Ah! Cool.

    Now it compiles but when I run it no values are being stored in the salary field. It just displays 0.0?

    Once I get some of these basics down I should be able to truck along.
  14. Replies
    17
    Views
    1,460

    New to Objects...

    I'm starting on a very simple program dealing with classes and objects and I'm confused about what's going on here...

    Class file

    public class Employee {
    private String fname;
    ...
  15. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    The good news is my teacher checked off this assignment. He didn't even look at whether or not the students were being sorted with the grades. The bad news is I now need to figure this out to satisfy...
  16. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    Well I've tried everything time will allow, but it's time for class. When I get to school I'll check back to see if you have come up with something. Even if you can't, I value everything you have...
  17. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    Yeah, That's the code I'm messing with but I'm running out of time fast!

    import javax.swing.JOptionPane;
    public class GradeExam2 {
    public static void main(String[] args) {
    ...
  18. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    This is the code with the methods. As you can see I have a few problems with it!
  19. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    Thanks for the tips. I've posted so many codes, I'm not sure which one you're referring to. About three posts ago I posted code that had separate methods.

    Could you maybe show me what you had in...
  20. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    Here is one without all the methods...

    import javax.swing.JOptionPane;
    public class GradeExam {
    public static void main(String[] args) {
    char[][] answers = {
    ...
  21. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    Wow, my brain hurts!

    Well this is the combination of the codes.

    import javax.swing.JOptionPane;
    public class GradeExam {
    public static void main(String[] args) {
    ...
  22. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    I'm not sure if this helps, but here is some code that will sort two values.

    public class SortTwoDimensions {
    public static void main(String[] args) {
    int m[][] = { { 4, 2 }, { 1, 7 }, {...
  23. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    Yes, each student has a unique grade and needs to sort with their perspective student.

    I now see what you mean about the brackets.

    Here is the fixed code

    import javax.swing.JOptionPane;
    ...
  24. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    Well I am not seeing the students switch with the correctCount. The students are not being sorted.

    Should I use

    int[][] student = new int[8][8];

    to store the two values?

    Also I'm not...
  25. Replies
    37
    Views
    3,961

    Re: Two-Dimensional Array to Grade Students?

    OK...let me mess with this logic
Results 1 to 25 of 72
Page 1 of 3 1 2 3