If someone could take a quick glance at my code and see if they can spot something that i did not, i would be very appreciative.
Thanks in advance!
Program Class:
public class Program
{
public static void main(String[] args)
{
double joYSalary;
double jaYSalary;
Employee johnDoe = new Employee();
Employee janeDoe = new Employee();
johnDoe.setFirstName("John");
johnDoe.setLastName("Doe");
johnDoe.setMSalary(1850.00);
janeDoe.setFirstName("Jane");
janeDoe.setLastName("Doe");
janeDoe.setMSalary(2000.00);
joYSalary = johnDoe.getMSalary() * 12;
jaYSalary = janeDoe.getMSalary() * 12;
System.out.println("John's yearly salary: " + joYSalary);
System.out.println("Jane's yearly salary: " + jaYSalary);
joYSalary *= 1.10;
jaYSalary *= 1.10;
System.out.println("John's yearly salary: " + joYSalary);
System.out.println("Jane's yearly salary: " + jaYSalary);
}
}
Employee Class:
public class Employee
{
private String firstName;
private String lastName;
private double mSalary;
public double getMSalary()
{
return mSalary;
}
public void setMSalary(double a)
{
a = mSalary;
}
public void setFirstName(String a)
{
a = firstName;
}
public void setLastName(String a)
{
a = lastName;
}
}
I would debug the program but the compiler the class requires i use is still in the beta stages and the debug feature is currently inop. thanks again in advance.
SIDE NOTE: I did write this program in C#, the language i'm most comfortable with and i got it to work just fine, and it looks like the code should be working to me, just can't figure out why the values are being passed.

New Topic/Question
Reply



MultiQuote







|