Sunday, October 6, 2013
Crazy Conversions!
This task involved creating a system that converts various units. We were only required to go from one to the other, but I made mine go both ways, except for on binary because I did not have time. The First two just used the simple equations for Temperature conversions and Distance conversions, but the Binary was where it got complicated. I was not sure how to make a way that you could type in the whole binary number with one go, and have that be converted, but I was able to get it to work with the enter one digit at a time method. Basically it asks how many digits in total (Up to 6) and it will set the ones up until where you chose to 0 (ie you choose 5, digit 6 becomes 0). Then it asks individually which digit is which, and multiplies those digits by the corresponding power of 2. From this program I learned that the "Brute force method" is not always the best way, and you can find yourself wasting hours doing something that you may all of a sudden realize could have been done in a much easier way, or in my case realize that you did it all wrong.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment