Find the cookies expiring, Programming Languages

Your program can be invoked with option: -d date, where date is entered in dd/mm/yyyy format. In this case, it must only print the following string:

Found cookies expiring before or on

To find the cookies expiring before, or on, the date given in the option, your program must convert this date to the Unix epoch format and compare it with the dates stored in cookies_file. The time of the date is always assumed to be 0 hours, 0 minutes, 0 seconds and the time used is the Coordinated Universal Time (UTC), also often referred to as Greenwich Mean Time (GMT). Perl has a function for converting a GMT time to the Unix epoch time.

Example with the example cookies_file given above:

Command line:

cookiemgr.pl cookies_file -d 31/12/2012

The Unix epoch format for 31/12/2012, midnight, is 1356912000. In file cookies_file there are three dates which are smaller or equal than 1356912000. Therefore, the output must be:

Found 3 cookies expiring before or on 31/12/2012 Option -d date can only be used once per command line (you can only ask for the cookies for a given date at a time).

In the case in which file  cookies_file contains no cookies expiring before or on the given date, your program must instead only print:

No cookies found expiring before or on

Example with the example cookies_file given above:

Command line:

cookiemgr.pl cookies_file -d 31/05/2010

The Unix epoch format for 31/05/2010, midnight, is 1275264000. In file cookies_file there are no dates which are smaller or equal than 1275264000. Therefore, the output must be: No cookies found expiring before or on 31/05/2010

Posted Date: 3/30/2013 1:20:26 AM | Location : United States







Related Discussions:- Find the cookies expiring, Assignment Help, Ask Question on Find the cookies expiring, Get Answer, Expert's Help, Find the cookies expiring Discussions

Write discussion on Find the cookies expiring
Your posts are moderated
Related Questions
Write a function drawCA(aname, coords) that uses the plot3 command to draw the C α backbone of the protein. When calling this function, you should pass in the aname and coords var

do you solve questions of assigments?

QUESTION 1 (a) (i) What is linear programming problem? (ii) Define and explain the following terms: (1) objective function, (2) decision variable, (3) constraints, (4) feasi

need a program of any multiplication algorithm implemented in assembly language x86 without using mul command

Implement a two-dimensional table in Prolog. Your program will contain: An insert_entry predicate that takes a table, row, column and an entry and inserts the entry at the g

The objectives of this assignment are to test your ability to create XML documents to contain well-defined information. This assignment will be used further in Assignment 2, so ple

about how to create the program in c

You have been employed by a bounty hunter to create hit list (yes... you better do this right). Create a Hit List program that can records the name, bounty, and difficulty for ten

Write a function called withdraw (in the file 'withdraw.m') that simulates withdrawing money from a bank account. The function takes a single input argument, a positive scaler doub

You are required to develop a content management system for the following scenario:   "A Travel Information (NTIK) system is to be designed to allow travellers to access to an elec