reset password
Author Message
jgarc659
Posts: 27
Posted 13:32 Mar 04, 2017 |

Hey everyone,

I just finished writing a functional program for problem 5, but my code is now over 300 lines long. I wrote numerous if and if-else statements for each of the 10 characters from in the user input - they're what take up the bulk of the code.

I have this nagging suspicion that there may a simpler way to code it using what we already know, but there's also the possibility that these techniques will be covered during the loops lecture next week.

Anyone else complete the problem with similarly long code?

kknaur
Posts: 540
Posted 14:41 Mar 04, 2017 |

Your code will be very long for this problem.  The simpler way would be to use a loop.  The point this week is to see the "longer way" of doing things without using loops and next week we will see how loops can help to shorten logic that repeats over and over.