Hi, I am currently taking an intro class to C++. Our teacher wants us to use any method to figure out how many weeks it will take to become a millionaire if.... on week 1, we are given 1 penny... on week 2, we are given 2 pennies... on week 3, we are given 4 pennies. We have to use a loop, so I don't think log functions are acceptable.
This is what I have so far (see below). It seems like it should work, but nothing happens when I run the program -- it just seems like the program is 'thinking' forever, without outputting anything to the console. To exit, I have to CTRL-C it. Any hints are very welcome! Thank you!
Incrementing "weeks" would not change the value of "pennis", and therefore not change the value of "dollars". You would need to recalculate "pennies" and "dollars" inside of the while loop for this to work.