Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program named SalespersonDemo that instantiates objects using classes named RealEstateSalesperson and GirlScout. Demonstrate that each object can use a SalesSpeech ( ) method

Write a program named SalespersonDemo that instantiates objects using classes named RealEstateSalesperson and GirlScout. 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 objects data fields.
First, create an abstract class named Salesperson. Fields include firstName and lastName; the Salesperson constructor requires both these values. Include properties for the fields. Include a method called GetName that returns a string that holds the Salespersons full namethe 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 the following:
TotalValueSold - The total value sold in dollars (an int initialized to 0)
TotalCommissionEarned - Total commission earned (a double initialized to 0)
CommissionRate - The commission rate (a double required as the last argument to the class constructor, after first name and last name).
The GirlScout class includes a field (TotalBoxes of type int) to hold the number of boxes of cookies sold, which is initialized to 0.
Include properties for every field for both of the above classes.
In order to prepend the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method. In order to do this, include the statement using System.Globalization; at the top of your program and format the output statements as follows: WriteLine("This is an example: {0}", value.ToString("C", CultureInfo.GetCultureInfo("en-US")));\table[[C. SalespersonDemo.cs],[1,using System;,Fla],[2,using static System.Console;],[3,using System.Globalization;],[4,class SalespersonDemo],[5,{],[6,static void Main()],[7,],[8,// Write your code here],[9],[10,}],[,,],[,,],[,,],[,,],[,,],[,,]]
image text in transcribed

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

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions