Hi everybody, i have a problem with my C# prog. I'm trying to create Date using console application. The date should run about 40 times and increment by day and month. I was expected to use array for the number of days in a month, and cretae an exception for # days in the leap year. Please if anybody understand my question...help...
Question
dalong
[C#] Update date
Hi everybody, i have a problem with my C# prog. I'm trying to create Date using console application. The date should run about 40 times and increment by day and month. I was expected to use array for the number of days in a month, and cretae an exception for # days in the leap year. Please if anybody understand my question...help...
Thanks so much
This is some of my code:
using System;
namespace LABI
{
class Date
{
private int day=1, month=1, year=1;
public Date(int d, int m, int y)
{
if (m>0 && m<=12)
for(int i=1; i<=12;i++)
{m+=i;
m = month;}
year = 2004 = y;
day = arr (d);}
public Date(int arrayday)
{
int[]numday = {0,31,28,31,30,31,30,31,31,30,31,30,31};
if (arrayday
{
for(int i=1;i<=31;i++)
day+=i;
}
}
static void Main(string[] args)
{
Console.WriteLine(day + "/" + month + "/" + year);
}
}
}
Link to comment
Share on other sites
1 answer to this question
Recommended Posts