Ok So I have to create a Date Class that will allow me to return the current day with data members of month , day, and year
this is what I have for from my Main() class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DateApp2
{
class DateApp
{
static void Main();
{
DateApp date1 =
new DateApp (10, 31, 2011, "10/31/11");
Console.Write (date1);
}
public static void DisplayResults(DateApp someDate)
{
Console.Clear();
Console.WriteLine("Current Date: " + someDate.CalculateDate().ToString("F1");
}
} // end of Main
} // end of DateApp Class
} //end of namespace
and this is what I have from my "Date Class(helper/worker)" :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DateApp2
{
class Date
{
private int monthDate;
private int dayDate;
private int yearDate;
private string currentDate;
} // end of Date Class
public int MonthDate
{
get
{
return monthDate;
}
set
{
monthDate = value ;
}
}
public int DayDate
{
get
{
return dayDate;
}
set
{
dayDate = value;
}
}
public int YearDate
{
get
{
return yearDate;
}
set
{
yearDate = value;
}
}
public string CurrentDate
{
get
{
return currentDate;
}
set
{
currentDate = value;
}
}
//default constructor
public Date()
{
}
public Date(int month, int day, int year , string current)
{
monthDate = month;
dayDate = day;
yearDate = year;
currentDate = current;
}
public Date (int month , int day , int year)
{
monthDate = month;
dayDate = day;
yearDate= year;
}
public Date (string today)
{
currentDate = today;
}
public CalculateDate()
{
return int monthDate, int dayDate, int yearDate
}
public override string ToString()
{
return string.Format ("{0,20}", "Date App") +
"\n\nMonth: " + monthDate +
"\n\nDay: " + dayDate +
"\n\nYear: " + yearDate +
"\n\nCurrent Date: " + CalculateDate().ToString("F1");
}
} // end namespace
:( Im going crazy with this..mainly for the fact its a new section...please help
These are the errors I have:
Error 17 'DateApp2.DateApp' does not contain a constructor that takes 4 arguments 13 18 DateApp2
Error 19 'DateApp2.DateApp.date1' is a 'field' but is used like a 'type' 14 28 DateApp2
Error 18 'System.Console.Write(string)' is a 'method' but is used like a 'type' 14 21 DateApp2
Error 4 Expected class, delegate, enum, interface, or struct 17 23 DateApp2
Error 7 Expected class, delegate, enum, interface, or struct 16 12 DateApp2
Error 8 Expected class, delegate, enum, interface, or struct 28 12 DateApp2
Error 9 Expected class, delegate, enum, interface, or struct 40 12 DateApp2
Error 10 Expected class, delegate, enum, interface, or struct 52 12 DateApp2
Error 11 Expected class, delegate, enum, interface, or struct 65 12 DateApp2
Error 12 Expected class, delegate, enum, interface, or struct 70 12 DateApp2
Error 13 Expected class, delegate, enum, interface, or struct 79 12 DateApp2
Error 14 Expected class, delegate, enum, interface, or struct 86 12 DateApp2
Error 15 Expected class, delegate, enum, interface, or struct 91 12 DateApp2
Error 16 Expected class, delegate, enum, interface, or struct 96 21 DateApp2
Error 2 Invalid token '(' in class, struct, or interface member declaration 14 27 DateApp2
Error 3 Invalid token ')' in class, struct, or interface member declaration 14 33 DateApp2
Error 1 Invalid token '{' in class, struct, or interface member declaration 11 9 DateApp2
Error 5 Type or namespace definition, or end-of-file expected 27 5 DateApp2
Error 6 Type or namespace definition, or end-of-file expected 28 1 DateApp2