Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C#: Inheritance rite a program named SalespersonDemo that instantiates objects using classes named RealEstateSalesperson and Gir1Scout. Demonstrate that each object can use a SalesSpeech (

C#: Inheritance

image text in transcribed

rite a program named SalespersonDemo that instantiates objects using classes named RealEstateSalesperson and Gir1Scout. Demonstrate that each object can use a SalesSpeech ( method appropriately. Also, use a MakeSale() method two or three times with each object, and display the final contents of each object's data fields. First, create an abstract class named Salesperson. Fields include first and last names; the Salesperson constructor requires both these values. Include properties for the fields. Include a method that returns a string that holds the Salesperson's full name-the first and last names separated by a space. Then perform the following tasks: . Create two child classes of Salesperson: RealEstateSalesperson and GirlScout. The RealEstateSalesperson class contains fields for total value sold in dollars and total commission earned (both of which are initialized to 0), and mission 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 properties for every field . Create an interface named ISellable that contains two methods: Salesspeecho akeSaleO. In each RealEstateSalesperson and GirlScout class and M implemen speech that the objects of the class could use t SalesSpeech ) to display an appropriate one- or two-sentence sales alesperson class, implement the MakeSaleO method to accept an integer dollar value for a house, add the value to the RealEstateSalesperson's total value sold, and compute the total commission earned. In the GirlScout class implement the MakeSaleO method to accept an integer representing the number of boxes of cookies sold and add it to the total field

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

Network in loosely tied and temporary social networks

Answered: 1 week ago