Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

can someone help me out with this

1 vue (au cours des 30 derniers jours)
Liam Sullivan
Liam Sullivan le 4 Mar 2020
Clôturé : MATLAB Answer Bot le 20 Août 2021
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 commentaires
per isakson
per isakson le 5 Mar 2020
Modifié(e) : per isakson le 5 Mar 2020
The if-statement doesn't handle the case c) copper.
Srivardhan Gadila
Srivardhan Gadila le 9 Mar 2020
@Liam Sullivan can you provide the error you are getting?

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by