Tuesday, December 7, 2010

Design patterns

Design patterns are recurring solutions to software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.

Click Here for Design patterns
..

3 comments:

  1. Section C
    Create an interface called Payable. This is the interface that will be used by the accounting department's software (which you are not responsible for authoring) for all things that they need to write checks for. The Payable interface should contain three functions:
    1. Retrieve amount due
    2. Add to amount due
    3. Payment address
    Derive an Employee class from the Person class. The Employee class should add the following properties:
    1. Salary
    2. Mailing address
    In addition, the Employee class should implement the Payable interface. The implementation of the functions specified in the Payable interface should make sense. In other words, the payment address should be the mailing address of the employee. In order to make this work right, you will need to allocate an internally protected state variable that keeps track of the amount of money due. This state variable will obviously be modified by the functions defined in the interface. You can of course, try to do this with a property and add this property to the Payable interface.

    ReplyDelete
  2. Section B
    Create a class called Person. Populate the Person class with the following properties to store the following information:
    1. First name
    2. Last name
    3. Email address
    4. Date of birth
    Add constructors that accept the following parameter lists:
    1. All four parameters
    2. First, Last, Email
    3. First, Last, Date of birth
    Add read-only properties that return the following computed information:
    1. Adult - whether or not the person is over 18
    2. Sun sign - the traditional western sun sign of this person
    3. Birthday - whether or not today is the person's birthday
    4. Screen name - a default screen name that you might see being offered to a first time user of AOL or Yahoo (e.g. John Doe born on February 25th, 1980 might be jdoe225 or johndoe022580)

    ReplyDelete
  3. Section A
    Lookup the System.DateTime structure. This type contains a large amount of functionality that allows a user to perform all sorts of interesting operations with dates and times. Use System.DateTime along with System.Console to implement a simple C# program that does the following:
    1. Ask the user for their birthday. It will probably be easiest to ask year, then month, then day rather than parsing a combined string reliably.
    2. Calculate the age of the user.
    3. Check to see if the age of the user is impossible. For example, if the user is not yet born, output an error message. If the user claims to be 135 years old, then let them know that's not possible.
    4. Output the age of the user to the console.
    5. If it is the user's birthday, output a nice message.
    6. Compute the user's astrological sign according to the Western (sun sign).
    • 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
    • Aquarius January 21 - February 19
    • Pisces February 20- March 20
    7. Output the computed sign to the console.

    ReplyDelete