Instructions:

You are required to design and write an application that will analyze an input file (InputFile.txt); the file contains a date on each line. Your algorithm should output all the missing dates, excluding Saturdays and Sundays. You should not cater for public holidays. Also keep in mind: each leap year (every 4 years) contains an extra date for February 29th. Leap years: 2000, 2004, 2008, …

Your results should also output a date range instead of each individual date; if there is more than one concurrent date missing. For example: if you are missing 2008/02/03, 2008/02/04 and 2008/02/05 you should output 2008/02/03 – 2008/02/05.

Your output should be written to a file (OutputFile.txt). A folder will be created on the Local Drive with your Name, this folder should contain all your solution and source files, as well as your output file.

This test will be marked and evaluated on the following:
• Architecture used.
• Your ability to follow simple instructions.
• Error handling.

Example:

If you input was:

2008/01/03
2008/01/04
2008/01/07
2008/01/08
2008/01/09
2008/01/11
2008/01/14
2008/01/18
2008/01/21
2008/01/22
2008/01/24

Your output should be:

2008/01/10
2008/01/15 – 2008/01/17
2008/01/23

Recommended Answers

All 2 Replies

Welcome.

Ask specific questions, don't ask people to do your homework. Please read member rules and homework policy at daniweb.

As adatapost has said, the policy here at Daniweb is to help those who have shown effort first.

To get you started, at the design stage you need to break down the problem into individual steps, then solve each of them. This is first achieved in pseudocode. You need to work out the steps involved in:
- reading in the file (see Streamreader)
- converting each line to a date (see Loops and DateTime)
- checking the day of the week for the date (see DateTime.DayOfWeek)
- checking if the date follows the previous date
- outputting results (see StreamWriter)

Do some reading, begin your design and if you get stuck on something specific, feel free to start a new thread and we will help you.
We are happy to help people learn, but we aren't here to do all the work for you.

Good luck, and remember to mark this thread as solved.

commented: Very good answer. +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.