• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Help with Methods please

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This post is a repost, I deleated the other one because it didnt make much sense. What I need help on is a third Method, ive already created, "computePayroll". this method wont take any parameters, I need to create a loop that will loop for times with each iteration representing a paricular week. Before the loop starts I need to have the method prompt the user for the seniorityBonus. Then for each iteration of the loop, the method needs to prompt the user for the weekly sales. Inside the loop I need to make calls to "computeSeniorityBonus" and "computeCommission" to generate the final salery for the week. Then I have to have the method total up the sales persons four weeks to have a monthly salary. I then need to return this value as a duoble to the main. Now I had a hard time getting my other two methods working, but thanks to you all here I was able to get it. I just dont know where to start with this method.
 
Author
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. You have the solution in front of you. To me the problem is not using methods but organizing your thoughts out first on paper. Psedocode first, then program.
2. Also, this is obviously a homework problem (i.e. using MyInput, project4, etc.) why don't you use your book to help you?
3. What does your instructor say?
Just my thoughts
 
Rob Walter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes it is homework and my teacher has asked us to get help from others. I'm not wanting someone to right code for me I just would like an example or help. My first question is would I have to create four different variables for week1, week2, week3, & week4, in my method so I can compute them?
reply
    Bookmark Topic Watch Topic
  • New Topic