Find the cookies expiring, Programming Languages

Assignment Help:

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


Related Discussions:- Find the cookies expiring

Python 2.7.3, I have assignment about python language . Could you helpe me ...

I have assignment about python language . Could you helpe me to built it

Program for create a menu, The creation of the menu will involve writing pr...

The creation of the menu will involve writing procedural code, using decision logic, writing a loop, and using the case statement.  Although it is not required for grading, it is r

Write a program to create map function, Given a list of numbers, say my ...

Given a list of numbers, say my @input_numbers = (1, 1, 3, 5, 8, 13, 21, 34, 55, 89, 144); write a program map1.pl that will use the function map (a) to produce a list of

Programming logic???, write c++ source code to find the number of digits i...

write c++ source code to find the number of digits in a given integer? pls ans

Write a program to show twenty ellipses, Write a Program to Show Twenty Ell...

Write a Program to Show Twenty Ellipses 1. Write a program to show twenty ellipses which move away from the mouse pointer. Their initial locations should be random.

Frotran 2000, Please explain about sub programming.

Please explain about sub programming.

Define the control statements in computer programming, Define the Control s...

Define the Control statements in Computer Programming? The statements are part of the program that performs some action. The compiler will check a program sequentially from the

Statistical parametric mapping, A large offshore accommodation barge is to ...

A large offshore accommodation barge is to be converted into a floating luxury hotel.  It will be connected to a single point mooring buoy (SPM) in a beautiful inland loch where th

Matlab help, I am working on a matlab project and need help debugging one q...

I am working on a matlab project and need help debugging one question i have written and need help working through another problem.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd