Check Your Stock Gains

Difficulty: Hard

The challenge for last month’s Exercise was to generate a table showing a stock price updated every 30 minutes during the trading day. This month’s Exercise expands upon the process by having your code examine the stock price highs and lows and determine the greatest increase in stock value. This calculation means more than just finding the high and low values.
Continue reading

Reading Wildcards from the Command Line

Back in May, I wondered how command line input could be processed when a wildcard is present (Lesson link). My research lead me to the glob() function, but you don’t use this function to process a command line wildcard argument. The reason is that these wildcards are handled by the shell; your code has no direct way to determine when a wildcard is present as a command line argument.
Continue reading

Watch the Stock Market

Difficulty: Medium

Stock prices fluctuate throughout the day based on news, fear, and speculation. If you own stock and desire the price to rise, you anxiously watch the stock tickers throughout the day, puzzled or delighted by the reactions. This month’s Exercise attempts to emulate such anxiety.
Continue reading

Wild About Wildcards

Wildcards were highly useful during the glory days of text mode operating systems. They still exist: ? represents a single character in a filename and * represents a group of characters. Using wildcards to manipulate files is a staple of computer file management, perhaps a lost art in the era of graphical operating systems, but still relevant. The C language is also still relevant, so how does it deal with wildcards in a filename?
Continue reading