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
@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