static void Main(string[] args) { RealEstateSalesPerson realEstatePerson = new RealEstateSalesPerson("Bill", "Gates", 0.07); GirlScout girlScountPerson = new GirlScout("Cindy", "Smith"); realEstatePerson.SalesSpeech(); girlScountPerson.SalesSpeech(); Console.WriteLine(""); realEstatePerson.MakeSale(1500); realEstatePerson.MakeSale(5000); realEstatePerson.MakeSale(55000); girlScountPerson.MakeSale(150); girlScountPerson.MakeSale(400); Console.WriteLine("Real Estate Sales Person: "); Console.WriteLine("Name:" + realEstatePerson.getFullName()); Console.WriteLine("Total Values Sold: " + realEstatePerson.totalValueSold.ToString("C2")); Console.WriteLine("Commission Rate: " + realEstatePerson.commissionRate.ToString()); Console.WriteLine("Total Commission Earned: " + realEstatePerson.totalCommission.ToString("C2")); Console.WriteLine(""); Console.WriteLine("Girl Scout Sales Person: "); Console.WriteLine("Name:" + girlScountPerson.getFullName()); Console.WriteLine("No of Boxes Sold: " + girlScountPerson.noOfBoxesSold.ToString()); Console.WriteLine(""); Console.ReadLine(); }
private void gsCreateButton_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(gsFNTextBox.Text) || String.IsNullOrEmpty(gsLNTextBox.Text)) { MessageBox.Show("You must enter a first and last name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } // end if else { gs = new GirlScout(gsFNTextBox.Text, gsLNTextBox.Text); gsCreateButton.Enabled = false; gsNameLabel.Text = gs.ToString(); gsNameLabel.Visible = true; gsSaleLabel.Visible = true; gsSaleTextBox.Visible = true; gsPitchButton.Visible = true; gsSaleButton.Visible = true; gsTotalSoldLabel.Visible = true; } // end else }