Info

この質問は閉じられています。 編集または回答するには再度開いてください。

can someone help me out with this

1 回表示 (過去 30 日間)
Liam Sullivan
Liam Sullivan 2020 年 3 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
i have to create a script for this problem but i keep getting an error. Why?
metaltype=input('','s');
weight=input('');
price=0;
if(strcmp(metaltype,'gold'))
price=weight*11750;
elseif(strcmp(metaltype,'silver'))
price=weight*177;
end
fprintf('price = %d',price);
  3 件のコメント
per isakson
per isakson 2020 年 3 月 5 日
編集済み: per isakson 2020 年 3 月 5 日
The if-statement doesn't handle the case c) copper.
Srivardhan Gadila
Srivardhan Gadila 2020 年 3 月 9 日
@Liam Sullivan can you provide the error you are getting?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by