Hi,
Has anyone ever done the SalesPersonDemo from the "Microsoft Visual C#.Net" book?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SamPosted Apr 10, 2010, 4:15 PM
7a. Create an abstract class named Salesperson. Fiels include first and last nams; the Salesperson constructor requires both these values. Include a get method that returns a string that holds the Salesperson's full name, which consists of the first and last name separated by a space. Save the file as Salesperson.cs
b.Create two child classes, RealEstateSalesperson and GirlScout. The RealEstateSalesPerson class contains a total value sold in dollars field and a total commission earned field (both of which are initialized to 0), and a commission rate field required by the class constructor. The GirlScout class includes a field to hold the number of boxes of cookies sold, which is initialized to 0. Include set methods for every field. Save the file as SalespersonSubclasses.
c.Create an interface named ISelling that contains two methods: SakesSpeech() and MakeSale(). In each class, implement SalesSpeech() to displat an appropriate one- or two-sentance sales speech that the object of the class could use. In the RealEstateSalesPerson class, implement the MakeSale() method to accept an integer dollar value for a house, add the value to the RealEstateSalesPeron's total value sold, and compute to the total commission earned. In the GirlScout class, implement the MakeSale() method to accept an integer representing number of boxes of cookies sold and add it to the total field. Save the file as ISelling.cs
d.Write a program that instantiates a RealEstateSalesPerson object and a GirlScout object. Demonstrate the SalesSpeech() method with each object, the use the MakeSales() method two or three times with each object. Display the final contents of each object's data fields. Save the file as SalespersonDemo.cs
I know its alot and i cant get any help from my instructor so your help would be greatly appreciated.
Thanks,
Sam
pintuPosted Apr 10, 2010, 2:29 PM
i will try to solve the problem