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