Whenever I feel like “There are things I can’t control or I can’t change this or something with more hopelessness like I can’t do this”
I speak to myself
Is this true ? No. There must be a possibility. Yes there is a possibility. It is possible. If it is possible then I can do it. If I can do it I should do it.
I find these lines to be hopeful. I think, saying these lines to yourself will also help you a lot.
OH !!! The problem is easy, I got it, I know what is tricky in the problem, I can definitely make this program and then you just start your work on keyboard and after working for a while all of a sudden you stop writing code.
Does this happens to you a lot of time ???
Okay then I guess, this post will help you in figuring out what you are missing…
So, What do you think, why it happens to you – because you don’t actually know what you need, what you need to design, you know how to write a program, how to code, how to indent and other required things, but what is that makes you stop writing …???
Its the Idea you need to get first of all…See how it helps.
To check that, I’d like you to follow these simple steps every time you begin coding
- To save a lot of time, you don’t really need to start directly with coding, In fact this should be the last thing to do.
So my first tip is – Take a pen & paper
- Observe carefully what is given to you, and what is asked – you may think that it is very simple, but this is what people underestimate, so please don’t just skip this part and give it extra time so that your mind can really understand what the problem is ??
So the second tip is – Plant the seed of problem in your mind.
- Now this is the time where power of experience comes, the more experienced you are in logic designing and problem solving, more quickly you will design you solution.
The third tip is – Design algorithm – See how this solution will works in your scenario
- If you think and if your solution fits over all the problem cases, Its time to move on to keyboard, write all your code what you’ve designed in your algorithm.
Fourth tip is – Write everything you know( Don’t try to trim the code at this moment)
- The time you’ll be exhausted and that’s why this task should be easy and see what you gotta do here
Fifth tip – Debugging – Try to resolve errors/warnings, indent your code, prepare documentation and try to shorten your code.
PROGRAMMING IS NOT ABOUT WRITING A CODE…A TYPIST CAN ALSO DO THE SAME…IT IS ALL ABOUT PROBLEM SOLVING
You want to write a program that
1) has a class ‘card’ which identifies each card from a pack of cards with number and suite like
Example: Ace of Hearts would be ‘1H’, 7 of Clubs would be ‘7C’, King of Diamonds would be ’13D’ etc.
2) the program should pick a random card from 52 cards that are part of standard deck (without jokers). and basd on card picked, output all possible combnations for a Full house in Poker containing that card.
if I pick 4S (for 4 of Spades), the output should say: you picked 4S all possible combinations of Full House containing
4S: 4S4C1S1C1H 4S4H1S1C1H 4S4D1S1C1H . . … etc. And
3) Print out the probability that you would get a full house if you pick this card, and 4 more cards at random
Get the code which tells you how much is the probability of getting a full House in a game of POKER from CS_IT folder from my box widget.