Karanbir S.

asked • 05/20/21

Your program should use Zeller's rule to output the day of the week any date occurred and for each weekday, output a proverb, fortune, piece of wisdom, etc....

I have everything but just need the fortunes. For example, "Tuesday's child is full of grace.".

Please help me add them to my code.

Here is the code:

using System;


class dttimeex57

{

static void Main()

{

int yr, mn, dt;


Console.Write("\n\n Find the day for a given date :\n");

Console.Write("------------------------------------\n");


Console.Write(" Input the Day : ");

dt = Convert.ToInt32(Console.ReadLine());

Console.Write(" Input the Month : ");

mn = Convert.ToInt32(Console.ReadLine());

Console.Write(" Input the Year : ");

yr = Convert.ToInt32(Console.ReadLine());

DateTime d = new DateTime(yr, mn, dt);

Console.WriteLine(" The formatted Date is : {0}", d.ToString("dd/MM/yyyy"));

DateTime pp;

pp = DayOfWeek(d);


Console.WriteLine(" The day for the date is : {0}\n ", pp.DayOfWeek);

}

public static DateTime DayOfWeek(DateTime dt)

{

DateTime ss = new DateTime(dt.Year, dt.Month, dt.Day);

return ss;

}

}


1 Expert Answer

By:

Patrick B. answered • 05/20/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Karanbir S.

It's giving me errors. Please add it to the code.
Report

05/20/21

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.