Zebra0.com

CMSC222: Project 4, Birthday

CMSC222: Project 4, Birthday

Section 30127: Due Sunday, March 24, 2024

Create a C# program that will use a date time pickercontrol to let the user select his birthday.

The dateTimePicker can be used to extract the month, day and year as shown below:

private void DateTimePicker1_ValueChanged(object sender, EventArgs e)
{
  DateTime d = dateTimePicker1.Value; 
  this.Text = ""+d.Date.Month;
}

After a date is selected, display the following information:

This assignment MUST be done using arrays wherever appropriate.

Please see video on furniture-assembly and seasons for an explanation of this algorithm.

Aquarius - January 21 - February 19
Pisces - February 20- March 20
Aries - March 21 - April 20
Taurus - April 21 - May 21
Gemini- May 22 - June 21
Cancer - June 22 - July 22
Leo - July 23 -August 21
Virgo - August 22 - September 23
Libra - September 24 - October 23
Scorpio - October 24 - November 22
Sagittarius - November 23 - December 22
Capricorn - December 23 - January 20

Use Google to find information about the Chinese years and the zodiac signs and to find pictures or use these pictures

Aside from using arrays this project is important because it is complex enough that you must write it one step at a time.

You can start with any step you understand, but this is an example.

  1. Create an array of the Chinese zodaic signs.
  2. Get just the year from the date picker (this.dateTimePicker1.Value.Year) and print the sign.
  3. Add a picture of the animal.
  4. Add each additional step in the same way.

This is a fun and interesting project that combines some of the skills you have learned. It is not important whether you believe in Astrology or not.

Example

When you finish, save and close.
Zip the whole project folder to create Lastname_Firstname_birthday.zip.
Upload the project in Blackboard.

Images

If you put the images in the Birthdays/bin/debug/images/ directory, this will display the picture:

String localDirectory = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);
this.Text = localDirectory;
picAnimals.Image = Image.FromFile(localDirectory + "/images/rat.png"); //use the year % 12 to find actual picture required.

The following are requirements:

If any of these requirements are not met, the score will be 0.

Item
correctly zipped">

If the requirements are met, the grade is as follows:

ItemPoints
3
3
3
3
3
3
3
3
4
3
3
5
5
6
Possible points=50

C

If you do not receive a perfect score you may resubmit it as long as it is resubmitted within 3 days.
Assignment Index

This web site, and all pages therein, are the sole property and responsibility of Zebra0.com.
It is not endorsed, sponsored, or provided by or on behalf of Montgomery College.