Easter occurs later this month, on the 16th. You can discover that date by using Google or by running the code solution for this month’s Exercise.
Continue reading
Author Archives: dgookin
Reducing Roman Numerals
I’m sure a mathematical solution exists to condense Roman numeral values. The values ending in 4 or 9 can be reduced, but whatever that solution is, it’s beyond me. So for my resolution to the Roman numeral reduction problem, I rely on strings instead of math.
Continue reading
Calculating the Date of Easter
Of all the annual holidays, Easter is the most difficult date to predict. It’s always a Sunday, but which one? It could land in March or April. Most people look at a calendar or (these days) use Google to find out when Easter occurs. Yet, you can write a program that tells you exactly when Easter falls.
Continue reading
From Decimal to Roman
The C language lacks a printf() conversion character to display Roman numerals. Therefore, if your code requires input of a decimal value, say 266, and output of a Roman numeral value, which would be CCLXVI, you must craft your own function.
Continue reading
From Roman to Decimal
Roman numerals are composed of letters, so it makes sense that their “values” are input and displayed as strings. To translate from that string into an integer, your program must convert each character into its corresponding decimal value. Sounds simple, right?
Continue reading
Decimal, Binary, Hexadecimal, Octal . . . Roman
As a programmer, you encounter new counting bases: binary, hexadecimal, and perhaps octal. As a human, you use decimal, but decimal is only a recent invention. Before 1600 or so, if you worked with numbers you probably used Roman numerals.
Continue reading
Detailed Examination of a CSV File – Solution
The task for this month’s Exercise is to read a CSV file, store the data, then manipulate and report. For my solution, I chose to create an array of structures in which to store the weather information.
Continue reading
The Ghost of Octal
Programmers become exposed to multiple counting bases as well as ways of representing values. As a human, you work in base 10, probably thanks to your 10 fingers. When you program, you learn about base 2 binary and base 16 hexadecimal. You study exponential notation as well, especially for crunching very large or very small values.
Somewhere in the mire, you encounter base 8, octal. You nod appropriately at the information as it’s glossed over, then you move on and never return to discover what was once a huge deal.
Continue reading
Detailed Examination of a CSV File
The brutal winter continues in my area, with no end in site! I saved weather data collected for 31 days from December to January in a CSV file. This file was used in last month’s Exercise. For this month’s Exercise, your job is to read the same data file, but also to report on the results.
Continue reading
Yes! It’s a String – or Number!
The standard library functions atoi() and atof() work well to translate text (ASCII) input into values, an int or float, respectively. When your code must know whether a string is really a value, more processing is required.
Continue reading