CSC 1800 Organization of Programming Languages Date Syntax 1 Assignment 2 ⚫ BNF/EBNF for date syntax ⚫ Five programs that check prime numbers (use a similar approach to Assignment 1) 2 2 1
Where is Date Syntax Used? ⚫ Applications that incorporate a date (birth date, anniversary, due date, appointment date, deadline, calendar event, etc.) ⚫ Programs that analyze textual input and find all dates ⚫ Program that perform computation with dates: days between, day of the week, date of special days, how many days you've been alive, etc. 3 3 Finding Date Syntax Samples Gather as many examples of date syntax as you can ⚫ Search your computer and external systems for various representations of a date and develop a description of each representation in BNF or EBNF. ⚫ Note: there are at least 12 commonly used representations, and perhaps more. 4 4 2
Assumptions ⚫ A date must contain day, month, and year. It is not valid if any of the three parts is missing. ⚫ A date may not contain any other components than day, month, and year, with the exception of field separators. 5 5 A Few Samples ⚫ 1/1/20 ⚫ January 1, 2020 ⚫ 1 Jan 2020 6 6 3
Recommend
More recommend