Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-05-2007, 04:04 AM
Member
 
Join Date: Nov 2007
Posts: 4
sonal is on a distinguished road
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?????????????????
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-05-2007, 04:12 AM
Member
 
Join Date: Dec 2007
Posts: 30
Leprechaun is on a distinguished road
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...
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-05-2007, 04:17 AM
Member
 
Join Date: Nov 2007
Posts: 4
sonal is on a distinguished road
help
Would i write that as a field first then put it into the constructor????
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-05-2007, 04:22 AM
Member
 
Join Date: Nov 2007
Posts: 4
sonal is on a distinguished road
cheerrrrr:)
thanks for helpping finish that constructor

dude your super cool
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT +3. The time now is 04:35 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org