473,944 Members | 2,982 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Employee Class - symbol problem

16 New Member
Hi

I am getting this error message ...can anyone help me out?????

C:\Documents and Settings\Jessic a Romero\Desktop\ Employee.java:2 3: cannot find symbol
symbol : method sethourlySalary (double)
location: class Employee
sethourlySalary (hourlyS);
^
C:\Documents and Settings\Jessic a Romero\Desktop\ Employee.java:2 4: cannot find symbol
symbol : method setweeklyHours( double)
location: class Employee
setweeklyHours( weeklyH);
^
C:\Documents and Settings\Jessic a Romero\Desktop\ Employee.java:8 2: cannot find symbol
symbol : variable weeklyH
location: class Employee
return weeklyH;
^
3 errors

Tool completed with exit code 1

Here is mi code


Expand|Select|Wrap|Line Numbers
  1. //Create by Jessica Romero
  2.  
  3. public class Employee{
  4.  
  5.     private String firstName;
  6.     private String lastName;
  7.     private String middleName;
  8.     private String socialSecurityNumber;
  9.     private String dateBirth;
  10.     private double hourlySalary; //Salary per hours
  11.     private double weeklyHours; //hours worked
  12.  
  13.  
  14.  
  15. public Employee (String first, String last, String middle, String ssn, String dateB, double hourlyS, double weeklyH){
  16.  
  17.     firstName = first;
  18.     lastName = last;
  19.     middleName = middle;
  20.     socialSecurityNumber = ssn;
  21.     dateBirth = dateB;
  22.     sethourlySalary(hourlyS);
  23.     setweeklyHours(weeklyH);
  24. }
  25.  
  26. public void setFirstName(String first){
  27.     firstName = first;
  28. }
  29.  
  30. public String getFirstName(){
  31.     return firstName;
  32.  
  33. }
  34.  
  35. public void setLastName(String last){
  36.     lastName = last;
  37. }
  38. public String getLastName(){
  39.  
  40. return lastName;
  41.  
  42. }
  43.  
  44. public void setMiddleName(String middle){
  45.  
  46.     middleName = middle;
  47. }
  48.  
  49. public String getMiddleName(){
  50.  
  51. return middleName;
  52. }
  53.  
  54.  
  55. public String getSocialSecurityNumber(){
  56.     return socialSecurityNumber;
  57.  
  58. }
  59.  
  60. public String getDateBirth(){
  61.     return dateBirth;
  62. }
  63.  
  64. public void setHourlySalary(double hourlyS){
  65.  
  66.     hourlySalary = ( hourlyS > 0.0 && hourlyS < 1.0 ) ? hourlyS : 0.0;
  67. }
  68.  
  69. public double getHourlySalary(){
  70.  
  71.     return hourlySalary;
  72. }
  73.  
  74. public void setWeeklyHours(double weeklyH){
  75.  
  76.     weeklyHours = ((weeklyH >= 0.0) && ( weeklyH <= 20.0))?
  77.     weeklyH :0.0;
  78. }
  79.  
  80. public double getWeeklyHours(){
  81.     return weeklyH;
  82. }
  83.  
  84.  
  85. public double earnings()
  86. {
  87.     return hourlySalary * weeklyHours;
  88. }
  89.  
  90.  
  91.  
  92. public String toString()
  93. {
  94.  
  95.     return String.format("%s: %s %s \n%s:  %s\n%s: %s  %.2f\n %.2f\n%s: %.2f",
  96.     "Employee", firstName, lastName, middleName,
  97.     "social security number", socialSecurityNumber,
  98.     "Date Birth",dateBirth,
  99.     "Salary", hourlySalary,
  100.     "Weekly Hours" , weeklyHours);
  101. }
  102.  
  103. }
Sep 29 '07 #1
4 2274
Ganon11
3,652 Recognized Expert Specialist
1) Please use [code] tags when posting code.

2) Check your spelling and capitalization of the methods and variables mentioned.
Sep 30 '07 #2
Jromero
16 New Member
My spelling is correct ... I don't see any problem.... please help me
Sep 30 '07 #3
Ganon11
3,652 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. C:\Documents and Settings\Jessica Romero\Desktop\Employee.java:23: cannot find symbol
  2. symbol : method sethourlySalary(double)
  3. location: class Employee
  4. sethourlySalary(hourlyS);
  5. ^
Expand|Select|Wrap|Line Numbers
  1. public void setHourlySalary(double hourlyS)
Expand|Select|Wrap|Line Numbers
  1. C:\Documents and Settings\Jessica Romero\Desktop\Employee.java:24: cannot find symbol
  2. symbol : method setweeklyHours(double)
  3. location: class Employee
  4. setweeklyHours(weeklyH);
  5. ^
Expand|Select|Wrap|Line Numbers
  1. public void setWeeklyHours(double weeklyH)
Expand|Select|Wrap|Line Numbers
  1. C:\Documents and Settings\Jessica Romero\Desktop\Employee.java:82: cannot find symbol
  2. symbol : variable weeklyH
  3. location: class Employee
  4. return weeklyH;
  5. ^
Expand|Select|Wrap|Line Numbers
  1. private double weeklyHours; //hours worked
  2. //...
  3. public double getWeeklyHours(){
  4.     return weeklyH;
  5. }
Are you sure your spelling is correct? Remember, Java is case sensitive, so sethourlyRate is different than setHourlyRate.
Sep 30 '07 #4
Jromero
16 New Member
Thank you, I will change the spelling
Oct 1 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1274
by: sajidazmi | last post by:
Hi, I'm coding an Stock Order Entry System. The problem I'm facing is when I'm passing a pointer to one class, the pointer gets corrupted. I'm not able to see why? Here is the code, please tell me what I'm doing wrong. Problem are marked as <== in the code. /** Class Header **/ /* * Symbol
17
19330
by: RSH | last post by:
I am really trying to grasp the concept of OOP as it applies to C#. I am looking at trying to set up a simple Employee Class but I am having trouble conceptualizing what this class should look like. I was hoping someone might be able to simply outline what I envision my class to look like: Basically I am envisioning a Class called Employee: I imagine it would have many properties(?) such as:
2
2189
by: Phil Davidson | last post by:
/* (Posted to microsoft.public.dotnet.languages.vc) In C++/CLI under Visual Studio 2005, creating an "enum class" member called "Equals" can cause compiler error C1060 (out of memory) and C1063 (internal error). See the following example program, a CLR console app. Of course the obvious workaround is to refrain from using "Equals". But does that really violate the specification of the language or the CLR? And can the compiler be...
3
4076
by: jhhbr549 | last post by:
Can some help me with this. Please review this code for errors. I can not get it to complie. Here is my Code .. This is an abstract class that is used in conjuntion with 4 other classes.. They are Hourly, IAm, Salaried, Sales. import java.util.*; //Constructors //Constructor public abstract class Employee
0
9971
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11306
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9868
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8234
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7396
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6313
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4918
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4516
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.