The While Loop

Introduction

Being in software engineering, specifically the job search, one is inundated with algorithmic problems. While there are many great tools out there for practicing, most of the problems aren’t super prevalent in everyday life. Meaning, those specific problems would never happen to me. There could be many reasons for my thinking this, primarily, my exposure to the actual engineering work place is very low, and these types of things haven’t been my norm. Or, I’ve never needed to reverse a string or find valid parenthesis in real life.

The Set Up

I was talking to a friend, and she asked me “If I make x amount of money now, and I get an annual raise of y percent, how many years will it take for me to make z amount?”

The Execution

The problem: given a starting salary and an annual 1.5% raise, how many years will it be before a new desired salary is reached?

Started Function
The While Loop

Conclusion

There are everyday uses for these types of coding resources/tools. If we keep our ears and eyes open, we might just find a way to use our skillset to help solve some very real and relevant problems!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store