Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help with this C# program. Please add necessary documentation for further

ID: 2246677 • Letter: P

Question

Please help with this C# program. Please add necessary documentation for further understanding. Thank you.

Write a C# console application named GirlScout that contains fields for a GirlScout's name, troop number, and dues owed. Include a constant static field that contains the last words of the GirlScout motto ("to obey the Girl Scout law"). Include overloaded constructors that allow you to set all three nonstatic GirlScout fields to default values or to parameter values. Also include properties for each field. Create a class named DemoScouts that instantiates two GirlScout objects and displays their values. Create one object to use the default constructor and the other to use the constructor that requires arguments. Also display the GirlScout motto. Save the class as DemoScouts.cs.

Explanation / Answer

Hi please

class GirlSccout
{
public const string GIRL_SCOUT_MOTTO = "to obey the Girl Scout Law";

string girlName;
int troopNumber;
double duesOwed;


public string GirlName
{
get { return girlName; }
set { girlName = value; }
}

public int TroopNumber
{
get { return troopNumber; }
set { troopNumber = value; }
}
  
public double DuesOwed
{
get { return duesOwed; }
set { duesOwed = value; }
}


public GirlSccout(string name, int number, double dues)
{
girlName = name;
troopNumber = number;
duesOwed = dues;
}
  
public GirlSccout() : this("Brownie", 1, 0.0)
{
}

public override string ToString()
{
return String.Format("Name {0}, Troop Number {1}, Dues Owed {2:C}", girlName, troopNumber, duesOwed);
}
}

class DemoScouts
{   
static void Main(string[] args)
{
GirlSccout girl1 = new GirlSccout();
Console.WriteLine(girl1);
GirlSccout girl2 = new GirlSccout("Angela", 2, 2.25);
Console.WriteLine(girl2);
Console.WriteLine("Our motto is : '{0}'", GirlSccout.GIRL_SCOUT_MOTTO);
Console.ReadKey();   
}
}

regards