I think my answer is not correct for this question, anyone can help me to check it? Thanks

4 ビュー (過去 30 日間)
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

採用された回答

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015 年 6 月 27 日
Hi,
It matches with your flowchart, Why do you thing it is not correct?
  4 件のコメント
Erwin Koman
Erwin Koman 2015 年 6 月 27 日
Okay, I get it. Thanks.
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015 年 6 月 27 日
Good, then would you please accept the answer.

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 6 月 27 日
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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by