I think my answer is not correct for this question, anyone can help me to check it? Thanks
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Erwin Koman
il 27 Giu 2015
Commentato: Salaheddin Hosseinzadeh
il 27 Giu 2015
Attached file is the question. Here is my code
B = 10000;
m = 0;
P = input('monthly payment?')
while B>0
B=B*(1.005);
B=B-P
m=m+1
end
0 Commenti
Risposta accettata
Salaheddin Hosseinzadeh
il 27 Giu 2015
Hi,
It matches with your flowchart, Why do you thing it is not correct?
4 Commenti
Più risposte (1)
Walter Roberson
il 27 Giu 2015
B = 10000;
m = 0;
P = input('monthly payment?')
while B>0
B=B*(1.005);
B=B-P; %changed
m=m+1; %changed
end
disp(m); %changed
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!