Question
Having a problem with this code. Error say its a handling error towards the end of the program: private void display() { throw new NotImplementedException();
Having a problem with this code. Error say its a handling error towards the end of the program:
private void display()
{
throw new NotImplementedException();
}
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace GirlsScout {
//GirlScout class defintion class DemoScouts { static string motto = "to obey the Girl Scout Law.";
private string name; private int troopnumber; private double dues;
//Ovreloaded constructors public DemoScouts() { name = "unknown"; troopnumber = 0; dues = 0; }
public DemoScouts(string name) { this.name = name; troopnumber = 0; dues = 0; }
public DemoScouts(string name, int troopnumber) { this.name = name; this.troopnumber = troopnumber; dues = 0; }
public DemoScouts(string name, int troopnumber, double dues) { this.name = name; this.troopnumber = troopnumber; this.dues = dues; }
//Name property public string Name { set { name = value; } get { return name; } } //TroopNumber property public int TroopNumber { set { troopnumber = value; } get { return troopnumber; } } //Dues property public double Dues { set { dues = value; } get { return dues; } }
public void printMotto() { Console.WriteLine("On my honor, I will try: To serve God and my country, " + " To help people at all times, And to obey the Girl Scout Law."); }
//method to display object data values public void display() { Console.WriteLine("Name : " + name); Console.WriteLine("Troop Number : " + troopnumber); Console.WriteLine("Dues : " + dues); Console.WriteLine("Motto : " + motto); }
} }
namespace GirlsScout { class GirlScout { private string v; private int v1; private int v2;
public GirlScout() { }
public GirlScout(string v) { this.v = v; }
public GirlScout(string v, int v1) : this(v) { this.v1 = v1; }
public GirlScout(string v, int v1, int v2) : this(v, v1) { this.v2 = v2; }
static void Main(string[] args) {
//Create an object of no argumets GirlScout gs = new GirlScout(); gs.display();
gs.printMotto();
//Create an object of 1 argumets GirlScout gs1 = new GirlScout("USA-Scouts"); gs1.display();
//Create an object of 2 argumets GirlScout gs2 = new GirlScout("USA_Scouts", 2121); gs2.display();
//Create an object of 3 argumets GirlScout gs3 = new GirlScout("USA_Scouts", 2121, 33); gs3.display();
Console.ReadKey();
}
private void display() { throw new NotImplementedException(); }
private void printMotto() { throw new NotImplementedException(); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started