Not sure how to add images to this post so Ill try to explain to the bes tof my abilites. this assignment is meant to text loops and while i got the entire code to work doing that, its the actual inner working that give issue. The program builds but when it's meant to display the costs it shows the same cost for each line within the loop.
for example:
year 1 1212
year 2 1212
year 3 1212
instead of
year 1 1212
year 2 1224
year 3 1236
Im not sure how to get the each new line to add 12 each time
case 2 is also giving an issue where it displays case 3's end results instead the intended results. case 2 is supposed to go by up by 24, not by 48.
and last but not least when the program loops to the beginning. it refuses to run again. so after one succesful run, it loops back to the beginning and if you try to make another selection it wont display the result, it'll just loop back to the beginning
Line 23? I valued years to 1 since having simply as int years wouldnt allow the program to build. Years is supposed to hold a value instead but like I said I couldnt get it to work without assigning 1 to it. and the first instance where I actually use it is in line 74, where it displays what I want without issue.
Well I see how I missed putting in the break statement for case 2 and 3. So that did help fix that. In fact this did fix everything. I followed your code and saw my mistakes. I did add that
1 2 3 4
constint max_number = 10
int min_number = 1
Something i picked up looking back at my book. before seeing your post. I've at this for the past 7 hours, so slowly but surely was inching towards it.
Now the only thing I got to fix is the cost+= fees doesnt display what i need for all 3 cases. I think I have to get a little more in depth.
The current code, the one above makes so the results of case one start at 1224 and go up by 12, so while the increment is correct its also supposed to start at 1212. case 2 results starts at 1248 and its supposed to start at 1224. case 3 results start at 1296 instead of 1248.
alright, let me see what I can do in one hour. Literally the last thing i need to fix to get this done properly. I wanna feel that sense of accomplishment once I figure it out.
The GOLD_CHOICE, and the other constant, I'm pretty sure I used incorrectly. They were meant to define each case within the switch but I did notice I didnt actually use since I named the case 1, 2, 3. I was assuming that they correlated to the constants.
So this is what I have so far, I kinda did a cop out with by using a new constant const cost_1 = 1880 but it made the job work to display the proper numbers. The loop isnt restarting properly though. Each time it runs, the results just continue on using the last series of numbers instead of starting from the very beginning. Looking into it to see how I can make it stop doing that.