Search:

Type: Posts; User: ibby50

Search: Search took 0.09 seconds.

  1. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    tried that before, got an error for the dob.getDay etc. And I NEED the dob. as in dateOfBirth = new Date(dob)
  2. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    where abouts do i put them? in the Person copy?
  3. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    i'm sorry I don't understand that
  4. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    Ok, this is Date:



    public class Date
    {
    // instance variables
    private int day, month, year;

    /**
  5. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    ok done that, now its saying an error in Person copy()

    cannot find symbol constructor Person(java.lang.String,char,java.lang.String)
  6. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    the first one I tried and I got an error when I entered the date in BlueJ when creating the person. I entered it like 12,12,12

    that right?

    the second one it gave me an error in the new copy...
  7. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    it doesn't. But I am not sure I can add more methods either to Date. Oh well.

    I did find one thing. In the spec, it says my dateOfBirth instance variable should be class Date

    does that change...
  8. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    thats all great.

    day, month, and year are all private in my Date class. and dateOfBirth is supposed to be in the Person class.

    The following is from class Person:


    public Person(String nme,...
  9. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    sorry, nothing is supposed to inherit from the date class. I am supposed to set the date of birth as a date type in person depending on what the user inputs and then get the integers again as a string
  10. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    public Date(int year, int month, int date)
    {
    year = this.year;
    month = this.month;
    setMonth(month);
    date = this.date;
    }

    brings the error message:
  11. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    I will try that code, although I am not totally sure if I am allowed to add more instance variables.

    And I tried the code with the this.sex code and it brought back cannot find variable sex
  12. Replies
    5
    Views
    5,244

    Re: Char to String - Gender method.

    Never mind guys, I figured it out. Turns out I had set Gender twice and turned out I didnt need the m or f if statement. Thanks anyways.
  13. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    Hey, yeah it would. But my spec specifies that dateOfBirth should be type Date. I have also just found out that in the controller I need to get the user to input a date of birth, but there isn't a...
  14. Replies
    27
    Views
    3,378

    dateOfBirth problems

    Hi, I am doing an assignment that requires me to input a Person with the usual params - name, gender, address, insurance number and date of birth.

    I have managed all but dateOfBirth. I will post...
  15. Replies
    5
    Views
    5,244

    Char to String - Gender method.

    Hi, I am doing an assignment where I need to get the user to enter m or f in gender and return male.

    My assignment criteria requires me to have gender as a char and sex as a char. I get error...
Results 1 to 15 of 15