User Profile

Collapse

Profile Sidebar

Collapse
xxbabysue123xx
xxbabysue123xx
Last Activity: Mar 24 '07, 06:32 PM
Joined: Jan 6 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • xxbabysue123xx
    replied to help with Student class
    in Java
    like this?

    Code:
      public class Student implements Comparable
       {
          private String  firstName,lastName, studentYear ;
          private int yearNumber,studentNumber;
          public static final String freshman = "freshman";
          public static final String senior = "senior";
          public static final String junior = "junior";
          public static final String
    ...
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    replied to help with Student class
    in Java
    is this better?

    Code:
     public class Student implements Comparable
       {
          private String  firstName,lastName, studentYear ;
          private int yearNumber,studentNumber;
          String freshman, junior, senior, sophomore;
          public static final int FRESHMAN=1;
          public static final int JUNIOR=2;
          public static final int SENIOR=3;
          public static final int SOPHOMORE=4;
    ...
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    replied to help with Student class
    in Java
    i still am having trouble this is what i did (i know parts of it are wrong)

    Code:
      public class Student implements Comparable
       {
          private String  firstName,lastName, studentYear ;
          private int yearNumber,studentNumber;
          String freshman, junior, senior, sophomore;
          public static final int FRESHMAN=1;
          public static final int JUNIOR=2;
          public static
    ...
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    replied to help with Student class
    in Java
    i fixed the compareTo method.... i don't know how to use the static variables in this program...
    Code:
     public class Student implements Comparable
       {
          private String  firstName,lastName, studentYear ;
          private int yearNumber,studentNumber;
          public static final int FRESHMAN=1;
          public static final int JUNIOR=2;
          public static final int SENIOR=3;
          public static
    ...
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    replied to help with Student class
    in Java
    i am still having trouble but tried what you sugested...is this right?


    Code:
    public class Student implements Comparable
       {
          private String  firstName,lastName ;
          private int studentYear,studentNumber;
          public static final int FRESHMAN=1;
          public static final int JUNIOR=2;
          public static final int SENIOR=3;
          public static final int SOPHOMORE=4;
    ...
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    started a topic help with Student class
    in Java

    help with Student class

    Heres the problem:

    Create a class Student with instance data name, studentNumber, class (where class is a String containing one of the following: “Freshman”, “Sophomore”, “Junior”, “Senior”.
    Make the class implement the Comparable interface. Include a toString method.
    Write a driver program to demonstrate your work.
    Instantiate several objects of the Student class.
    Call your methods several times...
    See more | Go to post

  • xxbabysue123xx
    started a topic variable types
    in Java

    variable types

    hi i just want to know if these answers are right..if they are wrong please correct me

    1) if you are told x sets aside space for its data when it is declared, what does this tell you about x?

    -- x is a static variable

    2) if a second variable y only sets aside space to hold an address, whatkind of variable is y?

    -- y is an object variable
    See more | Go to post

  • xxbabysue123xx
    started a topic interfaces
    in Java

    interfaces

    hi i need help with this question

    Assume a class BooList implements Comparable. Write an comesAfter method that returns the "larger" of the object or parameter, as determined by using implementation of Comparable.

    //i dont know if i did this right...
    public int comesAfter (String x, String y)
    {
    if (x.compareTo(y) >0)
    return x;
    else
    return y;
    }
    See more | Go to post

  • xxbabysue123xx
    replied to help with arrays
    in Java
    how would i find the smallest and largest values using that array and how many of each number came up when rolled 10 times?
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    started a topic help with arrays
    in Java

    help with arrays

    The question says: Using arrays use the Die class to roll the die 10 times and print the list of values that were stored in the array. Determine the smallest and largest number stored in the array. Also, determine how many of each values was rolled.

    I started parts of it but i don't know how to fill the rest....

    public class LotsOfDiceArray
    {
    final static int LIMIT = 10;//want to roll 10...
    See more | Go to post

  • xxbabysue123xx
    replied to help with interfaces
    in Java
    it works now...thank you very much for your help
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    replied to help with interfaces
    in Java
    or would this work..

    public double getDecimalEquiv alent()
    {
    return (double)numerat or/denominator;
    }

    public int compareTo(Objec t obj)
    {
    double tolerance=0.000 1;
    Rational myRational = (Rational) obj;
    double result = getDecimalEquiv alent() -
    myRational.getD ecimalEquivalen t();...
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    replied to help with interfaces
    in Java
    would this work..and how would i put tolerance in the compareTo method

    public double getDecimalEquiv alent()
    {
    return (double)numerat or/denominator;
    }

    public int compareTo(Objec t obj)
    {
    double TOLERANCE=0.000 1;
    Rational myRational = (Rational) obj;
    double result = getDecimalEquiv alent() -
    ...
    See more | Go to post

    Leave a comment:


  • xxbabysue123xx
    started a topic help with interfaces
    in Java

    help with interfaces

    THe question is:

    Modify the RationalNumber Class so that it implements the Comparable interface. To perform the comparison, compute an equivalent floating point value from the numerator and denominator for both Rational objects, then compare them using a tolerence value of 0.0001. Write a main driver to test your modifications.

    I tried by got an error (see last program)

    // THE Original Program
    //...
    See more | Go to post

  • xxbabysue123xx
    started a topic help with employee class
    in Java

    help with employee class

    here are a couple of questions i tried doing but not sure if they are correct. if anyone could please help with with them that would be great.. thanks


    An Employee will have a name, social security number, position, and hourly wages. Define the instance data for this class

    Answer:

    employeeName=na me;
    employeePositio n=position;
    hourlyWage=wage ;
    socialSecurityN umber=ssn;
    ...
    See more | Go to post
No activity results to display
Show More
Working...