how can i
-
These two programs are giving errors while compiling. WAP that counts the no. of occurence of particular character in a line of text. class demo { private int Occurance(string Input, string Find) { System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex(Find); // to display them do this System.Text.RegularExpressions.Match mt = rx.Match(Input); while (mt.Success) { System.Console.WriteLine("Found >>" + Find + "<< at position " + mt.Index.ToString()); mt = mt.NextMatch(); } // end display return rx.Matches(Input).Count; } } This program is giving error that entry point is not defined. ------------------------------- WAP to take 2 dates using objects(day,month,year)& display both dates,their comparison also that which one is greater(take the dates with the help of three parameter constructors) class demo { private DateTime getDate(int day, int month, int year) { return new DateTime(year, month, day); } private void compareDates(DateTime a, DateTime b) { if (a > b) Console.WriteLine(a.ToShortDateString() + " > " + b.ToShortDateString()); else if (a == b) Console.WriteLine(a.ToShortDateString() + " = " + b.ToShortDateString()); else Console.WriteLine(a.ToShortDateString() + " < " + b.ToShortDateString()); } } this program is giving error "type or namespace couldnot be found(are u missing a using directive or an assembly reference).
-
These two programs are giving errors while compiling. WAP that counts the no. of occurence of particular character in a line of text. class demo { private int Occurance(string Input, string Find) { System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex(Find); // to display them do this System.Text.RegularExpressions.Match mt = rx.Match(Input); while (mt.Success) { System.Console.WriteLine("Found >>" + Find + "<< at position " + mt.Index.ToString()); mt = mt.NextMatch(); } // end display return rx.Matches(Input).Count; } } This program is giving error that entry point is not defined. ------------------------------- WAP to take 2 dates using objects(day,month,year)& display both dates,their comparison also that which one is greater(take the dates with the help of three parameter constructors) class demo { private DateTime getDate(int day, int month, int year) { return new DateTime(year, month, day); } private void compareDates(DateTime a, DateTime b) { if (a > b) Console.WriteLine(a.ToShortDateString() + " > " + b.ToShortDateString()); else if (a == b) Console.WriteLine(a.ToShortDateString() + " = " + b.ToShortDateString()); else Console.WriteLine(a.ToShortDateString() + " < " + b.ToShortDateString()); } } this program is giving error "type or namespace couldnot be found(are u missing a using directive or an assembly reference).
-
These two programs are giving errors while compiling. WAP that counts the no. of occurence of particular character in a line of text. class demo { private int Occurance(string Input, string Find) { System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex(Find); // to display them do this System.Text.RegularExpressions.Match mt = rx.Match(Input); while (mt.Success) { System.Console.WriteLine("Found >>" + Find + "<< at position " + mt.Index.ToString()); mt = mt.NextMatch(); } // end display return rx.Matches(Input).Count; } } This program is giving error that entry point is not defined. ------------------------------- WAP to take 2 dates using objects(day,month,year)& display both dates,their comparison also that which one is greater(take the dates with the help of three parameter constructors) class demo { private DateTime getDate(int day, int month, int year) { return new DateTime(year, month, day); } private void compareDates(DateTime a, DateTime b) { if (a > b) Console.WriteLine(a.ToShortDateString() + " > " + b.ToShortDateString()); else if (a == b) Console.WriteLine(a.ToShortDateString() + " = " + b.ToShortDateString()); else Console.WriteLine(a.ToShortDateString() + " < " + b.ToShortDateString()); } } this program is giving error "type or namespace couldnot be found(are u missing a using directive or an assembly reference).
Remember that the sintax is:
using System; //All namespace to attach namespace demo { public class demo { public demo() { //this is the constructor but if the app is console application you need de main method } public Main() { this.demo(); } private int Occurance(string Input, string Find) { System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex(Find); // to display them do this System.Text.RegularExpressions.Match mt = rx.Match(Input); while (mt.Success) { System.Console.WriteLine("Found >>" + Find + "<< at position " + mt.Index.ToString()); mt = mt.NextMatch(); } // end display return rx.Matches(Input).Count; } private DateTime getDate(int day, int month, int year) { return new DateTime(year, month, day); } private void compareDates(DateTime a, DateTime b) { &nbs