Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// This is written in C# using visual studio 2015, the book it is basing the figure 11.10 off of is Visual C# How To

image text in transcribed

// This is written in C# using visual studio 2015, the book it is basing the figure 11.10 off of is Visual C# How To Program, Deitel H.M, Deitel, P.J 6th Edition or if you have the 5th edition it is figure 11.8 or 11.9. PLEASE BASE THIS ANSWER OFF OF THE BOOK'S FIGURE,THE FIGURE HAS A CODE IN IT THAT SHOULD BE USED WHEN CREATING THE REST OF THE PROGRAM,PLEASE USE THAT CODE AND GIVE THE EXACT OUTPUTS IT IS ASKING FOR. //Please show all steps and comment out what was done. Attached is a copy of the figure code that should be used in it.

Create a class called Woodmaker that inherits from the CommissionEmployee class in Figure 11.10 In your Woodmaker class, Earnings() should calculate the fee earned for a carpentry job. Gross sales represents the amount charged to a customer and commission rate represents the % that a particular carpenter earns. Woodmaker Earnings is calculated as the skill level base rate + amount charged * commission rate. Skill level base rate is $500 for an experienced carpenter and $250 for an apprentice. Your class should contain a constructor that inherits from the CommissionEmployee class and initializes the instance variables. The Woodmaker class should add an instance variable for the name of the customer where the carpentry service occurred. Also add an instance variable to represent skill level. Create a property for them also. Create a second class that prompts the user for the information for two carpenters, creates the 2 two carpenters objects, then displays each two carpenters. One carpenter should be experienced and one should be an apprentice.

5 using System 7 public class BasePlusCommi ssionEmployee CommissionEmployee private decimal baseSalary: // base salary per week // six-parameter derived class constructor // with call to base class CommissionEmployee constructor public BasePlusCommissionEmployeeC string first, string last, 14 string ssn, decimal sales, decimal rate, decimal salary :base first, last, ssn, sales, rate 7 BaseSalary salary;II validate base salary via property // end six-parameter BasePlusCommissionEmployee constructor // property that gets and sets // BasePlusCommissionEmployee's base salary public decimal BaseSalary 23 24 26 get return baseSalary II end get set 0 if(value >_ 0 ) baseSalary value; 32 else throw new ArgumentOutOfRangeException "BaseSalary" value, "BaseSalary must be >= 0" ); 5 // end set // end property BaseSalary 7 // calculate earnings public override decimal Earnings O return BaseSalary +base.EarningsO // end method Earnings 2 // return string representation of BasePlusCommissionEmployee public override string ToStringo) 5 return string. Format ( "base-salaried {0} base salary: {1:C}", base.ToString), BaseSalary 9 0 // end method ToString end class BasePlus CommissionEmployee

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions