![]() |
Re: Programming Challenges?
Before we move on too far here's my attempts at the previous challenges
Both are VB.net console Apps. Mutliples of 3 and 5 without using any type of Modulus functions: Spoiler:
And a quick and dirty way of calculating the Monty Hall probabilities (with thanks to Damien for coding tips) Spoiler:
|
Re: Programming Challenges?
Quote:
Here's the Door class with proper encapsulation (I would normally prefix private class variables with _ (like _doorNumber) but that's just convention) Spoiler:
I tend to find because I use OO a lot now that unless something is really small (i.e. an algorithm rather than a game) that I start building it in OO first and then scaling back if it really gets unnecessary. BTW the point being of all that is that you can control what comes in and out of the class. For example for the prize, I can make sure its one of x pre-determined prizes, that a door number is greater than 0, etc. |
Re: Programming Challenges?
Quote:
|
Re: Programming Challenges?
Here's my mortgage length calculator:
Spoiler:
|
Re: Programming Challenges?
Here's my mortgage calculator, using recursion
Spoiler:
How do you get indentation in the code? My code is indented when I paste it, but I lose indentation in the spoiler tags. Even spaces don't stick... |
Re: Programming Challenges?
I did wonder about recursion...
Spoiler:
I'm still sure there must be an equation for it rather than just iterating through. |
Re: Programming Challenges?
Quote:
|
Re: Programming Challenges?
Quote:
Try wrapping the code in [Code][/Code] tags inside the [Spoiler][/Spoiler] tags. i.e. [Spoiler][Code] ..... ...... [/Code][/Spoiler] or similar. Can anyone tell me how to stop my code appearing in colour when I Copy from the standard VB 2005 Express Editor and Paste in here ?? like this: Code:
PrivateSub StopTheseColours() |
Re: Programming Challenges?
Paste into Notepad first?
Or, highlight the pasted text and set the font color to black? |
Re: Programming Challenges?
I did it simply but the results where wrong. I thought interest was a set % amount of the total balance. I take it you need to apply it per month instead?
|
Re: Programming Challenges?
Quote:
Mine calculates on the yearly balance, however. |
Re: Programming Challenges?
Quote:
|
Re: Programming Challenges?
Quote:
Spoiler:
|
Re: Programming Challenges?
Quote:
Thanks for answering :). I'd already used the Paste to Notepad route which works but unfortunately strips out blank lines between code lines, which means you have to edit the code in Notepad to double every blank line. Changing the Font colour is a nice thought, but the coloured code in here is also broken code. Spaces between keywords are stripped and the indentation is also stripped. Guess I'm just looking for the laziest way of doing it (as usual, lol). |
Re: Programming Challenges?
Quote:
|
All times are GMT +1. The time now is 05:36. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum