Tuesday, March 11, 2014

Finally got in some coding geez...and its tuesday lol

Finally got to do some coding and reading today. Added two different programs this time

https://github.com/s0nlxaftrsh0ck/BottlePrice

basically the same as Glazing calc but calculating bottle amounts. The 99 is to offset the division so as to not give me a 0 as it divides anything less than 100 wil be 0....a bit of a better explanation...

 "If you just divide the number of tablets by 100 an integer division will give you the wrong answer (for any number of tablets less than 100 your program will tell you that 0 bottles are needed). One way to solve this is to add 99 to the number of tablets before you perform the division, forcing the number of bottles required to "round up" any number of tablets greater than 0."

and

https://github.com/s0nlxaftrsh0ck/FloatTest

This is a  program for testing out casting where you tell the program you are sure you are changing it from a larger variable to a smaller one. Something like changing an int into a float.

A float is bigger than an int. If it was int > float there wouldn't be a problem.

But since its float we need to compact it i guess you could say into the int.


Thats...what i gathered so far anyways...

Next time will be if else statements. This refresher course is pretty damned helpful and im glad im taking it back from step one to solidify my understandings of what the hell i was doing in programming. That tis be it for now

No comments: