Programming Puzzle #3

Hello Computer Scientists! Here are some solutions to last week’s puzzle. The level 2 sentences were: “Congratulations! You did the first one correctly!” and “The enemy will attack at dawn!”. Level 3 was a little more challenging. The way I did it was to look at the frequency of each letter and compare that to the English language:…/380px-English_letter_frequen…. I wrote a program that counted the frequency of each letter in the encrypted text and then replaced them according to that chart. By the time I had replaced the top 10 letters, the text was easily readable.

This week we’ll be looking at dates and times. Level 1: for those just learning: print out the current date and time in 3 different formats. For example: “2017/10/07”, “Saturday, October 7” and “Sat Oct 7 9:04:05 CDT 2017”. Level 2: Let the user enter a date and start a countdown clock to show them how many days, hours, minutes and seconds until that date. Will it work for something in the year 4017? What about the year 504928305847? Level 3: When you run the program, your computer says the date and time out loud! You’ll need some fancy text-to-speech programming for that one. Good luck!