• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stuck on simple program  RSS feed

 
Edward Wright
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
New noob to java here. Thanks for entertaining us. I believe I am in the right forum with my code posted correctly. My project is to create a console program that calculates annual salary for an employee that includes 100k in fixed income plus commission that for total sales of .05 of total sales. I think I got everything down but the part where I want the display message method to display the inputted name and the computed total compensation. I can't figure out how to link the value I assigned to "userCommiss" in line 42 of the first class with display output I have set up in line 27 of the second class. I want to just add the variable "userCommiss" in with the display message after the getEmployeeName argument.

 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Here is a question: How did you get the UserName/EmployeeName from one class to the other? Do you think you could use the same trick for this other variable?
 
Edward Wright
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot what exactly is going on in that statement. Let me go over it again and I'll get back with you.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

It does little to help somebody who is trying to work out the question, if you give a complete answer. Please have a look at this, which appears on the contents page of this particular forum:-
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
Please don't be annoyed, but I have pulled rank and deleted your post. It might be possible to restore it later.
 
Edward Wright
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Welcome to the Ranch

It does little to help somebody who is trying to work out the question, if you give a complete answer. Please have a look at this, which appears on the contents page of this particular forum:-
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
Please don't be annoyed, but I have pulled rank and deleted your post. It might be possible to restore it later.

His post which I saw, was incomplete or inaccurate anyway. I ended up finally figuring out enough to get the program to run as desired and decided to post the results anyway just for feedback purposes.

Below is the main file:


Here is the other file:


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!