Sunday, January 29, 2012
Chapter 3 wrap up
Both the projects were a bit more fun, the Temperature Converter might be more useful than the Stadium seating one. Eventually I would like to try port the Temperature Converter to my Android phone, just so I can easily have a conversion program that I could debug should it need to be. Out of the two programs, the Temperature Converter did give a bit more problems as I made the assumption that C# was as flexible as a graphing calculator and needed parenthesis to separate the (9/5) and (5/9). This ended in a logic error displaying 32 as the answer. I think saving the easiest button for last to program does make things easier. Now, I look forward to typing this.Close(); as it means my program is done.
Subscribe to:
Post Comments (Atom)
The thing to remember is that it follows the order of operations like a pirate going for the last drop of rum...
ReplyDeleteFor computers, the expression 2 + 3 × 4 = 14.
For humans, the expression 2 + 3 × 4 = 20.
In simple equations like that, parenthesis aren't necessary because mult./div. takes precedence over add./sub.
- It always goes left to right.
- Parenthesis/Brackets are first.
- Exponents/roots are second.
- Multiplication/Division is third.
- Addition/Subtraction are last.
A good, if ultimately nerdy, page to read is the TechNet article: http://msdn.microsoft.com/en-us/library/2bxt6kc4.aspx
FYI...for Android development, I've done localization for friends who are developers (porting their English apps into Japanese), and they use http://mono-project.com/ and write in C#.