Jump to content

Recommended Posts

Write the following program as a Web Application in PHP where you present a form for the user to enter the input and then display the output after the user submits the form.

 

IMPORTANT

• Read the question carefully so that we know your ability to understand requirements clearly,

• Look at the sample code and follow that structure.

• Pay attention to coding standards and neatness of code. Try to use existing PHP functions if applicable.

• Do NOT do any File Processing.

• If you are not clear about something, please write down a comment noting your assumption or asking a question.

 

YOU WILL BE REJECTED IF

• You make assumptions that are opposite to what has been provided in the question.

• You write your code in one single block without structuring it properly.

• You copy-and-paste code and there is code duplication.

 

APPLICATION

 

Accept two date values as Date Range A.

Accept two date values as Date Range B.

 

Perform the following validations and throw errors if they fail (and exit the program)

 

• All the date values are in MM/DD/YYYY format

• All the date values are actual valid dates (including February in leap year)

• For each date range, ensure first date is less than the second date

 

If validation succeeds, check the dates and give one of the following answers:

 

• Date Range A is COMPLETELY BEFORE Date Range B.

• Date Range A is COMPLETELY AFTER Date Range B.

• Date Range A is COMPLETELY INSIDE Date Range B.

• Date Range A COMPLETELY INCLUDES Date Range B.

• Date Range A OVERLAPS Date Range B and STARTS BEFORE Date Range B STARTS

• Date Range A OVERLAPS Date Range B and STARTS AFTER Date Range B STARS

 

Don’t simply use “less than” and “greater than” only. Some of the conditions require “less than or equals” or “greater than or equals”. Also in some of the above cases, you may need to compare one set of dates.

 

Please test your program with different input conditions and make sure that all 7 scenarios are covered.

Link to comment
https://forums.phpfreaks.com/topic/270774-give-the-solution/
Share on other sites

YOU WILL BE REJECTED IF

  • The only attempt you make is to post your assignment on a programming help forum, with a title demanding to be given something, without even asking a question in the post.

Edited by PFMaBiSmAd
Link to comment
https://forums.phpfreaks.com/topic/270774-give-the-solution/#findComment-1392930
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.