Click here to Skip to main content
15,943,008 members
Please Sign up or sign in to vote.
1.00/5 (8 votes)
See more:
Part 1
Write a program that calculates and prints the take – home pay for a commissioned sales employee. Allow the user values for the name of the employee and the sales amount for the week. Employees receive 7% of the total sales .Federal tax rate is 18%. Retirement contribution is 10%.Social security tax rate is 6%. Use appropriate constants, design an object oriented solution, and write constructors. Include at least one mutator and one accessor method and provide properties for the other instance variables. Create a second class to test your design.
Note: A sample executable file for part 1 is on the files for the classes in part 1 are in the

Part 2
Write a program that computes the amount of money the computer club receives from proceeds of their granola bar sales project. Allow the user to enter the number of case sold and the sale price per bar. Each case contains 12 bars; each case is purchased at $5.00 per case from a local vendor. The club is required to give the student government association 10% of their earnings. Display the proceeds formatted with currency. Write methods for your solution.
To get started with part 2

Step 1: Write the method to get the amount of bars sold.
static int BarsSold(double casesSold)
    const int BARS_PER_CASE = 12;
       //return Bars Sold which is cases sold * bars per case


Step 2 : Next write the method to get the gross sales.The bars sold which is retrieved from above step 1 is passed as parameter as bars sold.
static double GrossSales(double price, int barsSold)
      //return the gross sales which is price * bars sold
Step 3 : Next write the method to calculate the net sales.The case sold and gross sales from step 2 above is passed as parmeter
static double NetSales(double casesSold, double grossSales)
    const double WHOLESALE_COST_PER_CASE = 5.00;
     //return net sales = gross sale - ( case sold * wholesale cost per case)
Step 4 : Write the method to calculate government fee due. The net sales from step 3 above is passed as parameter.

static double GovtFeeDue(double netSales)
 const double ASSOCIATION_FEE_RATE = 0.10;
 //calculate the Govt Fee due and return it.
   (Assosication fee rate * net sales.

Step 5 : Write the method to calculate Net profit. The net sales from step 3 and government fee due from step 4 above is passed as parameter
static double NetProfit(double netSales, double govtFeeDue)
    //return net profit which is net sales - govt fee due.

Step 6 : Display the results. Only the net profit need to be displayed so the profit refers to the net profit from step 5 above.
static void DisplayResults(double profit)
            //display Net Profit.


Step 7 : Write the methods in main to manipulate the data.
Updated 17-Jul-11 3:14am
Keith Barrow 17-Jul-11 9:08am    
Beyond lazy. Most posters trying to get us to do their work at least have the decency to try and pretend it is not a homework/exam question. This isn't how the world works, as you are about to find out.

Obviously, yes - there are many capable programmers here on CP.

Try looking at their web pages for contact information.

Best regards
Espen Harlinn
Share this answer
Tarun.K.S 17-Jul-11 8:44am    
Hahhahahaa! Best answer ever! :D
Espen Harlinn 17-Jul-11 8:50am    
Thanks Tarun :)
thatraja 17-Jul-11 9:07am    
He can find your website too, 5!
Espen Harlinn 17-Jul-11 9:16am    
Thanks thatraja :)
Sergey Alexandrovich Kryukov 18-Jul-11 4:13am    
LOL. But all correct. My 5.
We are not here to do your home work, why don't you do it yourself , if you have any specific issue then come here again and we will help you for sure!!
Share this answer
Sergey Alexandrovich Kryukov 18-Jul-11 4:17am    
Right, a 5.
Uday P.Singh 18-Jul-11 5:07am    
thanks SA :)
I have read your homework questions and have decided that yes, I can write them.

I think I would charge about £250 for each one, and once you have paid me I shall begin the task.

I mean we are all professionals here, we have learnt our various trades over time and wouldn't want to work for nothing.

If you would like to become a professional and earn money from your education, I would advise that you learn how to learn, and asking people to do the work for you is not going to help.

Show us what you have done, and where you are having problems and people will willingly help you.
Share this answer
Espen Harlinn 17-Jul-11 8:54am    
Right :)
Uday P.Singh 17-Jul-11 8:57am    
good one my 5 too!!
thatraja 17-Jul-11 9:05am    
You may outsource that work for £200 to me, 5!
Keith Barrow 17-Jul-11 9:06am    
Spot on Dave, too much of this goes on. Experience has shown he might even be *in* his exam. The timing is correct for his part of the world. I feel sorry for good Indian devs, because they must compete for jobs with this sort.
thatraja 17-Jul-11 9:29am    
Keith, I remember you bookmarked this answer, we both forgot to post that as an answer :)
Share this answer
Espen Harlinn 17-Jul-11 11:27am    
I'm struggling a little with connecting that article with this question ..., was it perhaps meant for another one?
thatraja 17-Jul-11 11:33am    
No, it's a general advice/suggestion which suits to questions like this. I don't want copy/paste(plagiarism) because it's Sandeep's regular template :D
Espen Harlinn 17-Jul-11 11:36am    
Ok :)
Sergey Alexandrovich Kryukov 18-Jul-11 4:15am    
By some reason I got it at once. My 5.
Share this answer
Sergey Alexandrovich Kryukov 18-Jul-11 4:16am    
Tell them! They need it! My 5.
haha..yes anybody can write it..
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900