Results 1 to 4 of 4
  1. #1
    sonal is offline Member
    Join Date
    Nov 2007
    Posts
    4
    Rep Power
    0

    Default hi there i am stuck with a construct can anyone help???

    write a constructor which sets the job's reference number, the staff name, number of pages, number of copies, whether double-sided and submission time. The submission time should be represented by two formal parameters of type int which are then passed on as actual parameters to a time constructor. the date the job is required should be set to null.

    this is the constructor have to far

    public Job(int jobRef, String memStaff, int numOfpages, int numOfcopies, boolean copiesDoubleSOrnot, Date dateOfJob,Time jobsubTime)
    {

    jobReferncesNumber = jobRef;
    MemberofStaff = memStaff;
    NumberofPages = numOfpages;
    NumberofCopies = numOfcopies;
    CopiesDoublesidedorNot = copiesDoubleSOrnot;

    dateOfJob=null;
    copiesDoubleSOrnot = copiesDoubleSOrnot;
    JobsSubmissionTime = jobsubTime;
    if (copiesDoubleSOrnot = true)
    {
    cost=0.03 * numOfcopies * numOfpages;

    }
    else
    {
    cost=0.02* numOfcopies* numOfpages;



    }
    }

    i keep get this message when i try to compile" cannot find symbol-variable cost"

    if anyone could help me with this constructor?????????????????

  2. #2
    Leprechaun is offline Member
    Join Date
    Dec 2007
    Posts
    30
    Rep Power
    0

    Default

    From what you've posted as far as your code goes it looks like you need a declaration of the variable. Such as
    double cost;

    Hope that helps...

  3. #3
    sonal is offline Member
    Join Date
    Nov 2007
    Posts
    4
    Rep Power
    0

    Default help

    Would i write that as a field first then put it into the constructor????

  4. #4
    sonal is offline Member
    Join Date
    Nov 2007
    Posts
    4
    Rep Power
    0

    Default cheerrrrr:)

    thanks for helpping finish that constructor

    dude your super cool

Similar Threads

  1. Stuck on Two Questions, Please Help
    By sylo18 in forum New To Java
    Replies: 5
    Last Post: 03-11-2008, 01:03 AM
  2. musically stuck cry for help 2
    By geork in forum New To Java
    Replies: 0
    Last Post: 02-07-2008, 02:09 PM
  3. musically stuck
    By geork in forum New To Java
    Replies: 1
    Last Post: 02-06-2008, 09:44 PM
  4. Stuck and Frustrated.
    By jazzinspace in forum New To Java
    Replies: 7
    Last Post: 01-12-2008, 02:38 PM
  5. I am completely stuck
    By jpnym15 in forum New To Java
    Replies: 2
    Last Post: 11-14-2007, 06:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •