FOR Loop Final Answer Problem
Show older comments
Question gives us the vector increase which has the percentage increase for the fees of upcoming years and asks us to find the tuition fee after 4 years if current fee for a year is 5000
Exact Question:

My code is as below. It runs but final value is not correct.
sum = 5000;
increase = [10 8 10 16 15 4 6 7 8 10 8 12 14 15 8 7 6 5 7 8 9 8];
for x = increase(:,1):increase(:,3)
sum = (sum*(x/100)) + sum;
end
fprintf('%d', sum)
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!