Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
can someone help me out with this
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
per isakson
am 5 Mär. 2020
Bearbeitet: per isakson
am 5 Mär. 2020
The if-statement doesn't handle the case c) copper.
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!