FOR Loop Final Answer Problem
Afficher commentaires plus anciens
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)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
