Need help with conversion program
古いコメントを表示
Need help creating a program that is capable of converting from cm or in or ft into units of cm or in or ft. If incorrect units are input by the program user print an appropriate message and do not perform conversion.
ex] Command window should prompt 3 times:
Enter the Input Distance: 1
Enter the input Units(cm,in,ft): ft
Enter output units to convert to(cm,in,ft): in
1 ft = 12 in
ex]
Enter the Input Distance: 1
Enter the input Units(cm,in,ft): x
Incorrect input units
Thanks
採用された回答
その他の回答 (1 件)
Walter Roberson
2014 年 2 月 13 日
編集済み: Walter Roberson
2014 年 2 月 13 日
Units=input('Enter Units Of Distance(cm,ft,in):', 's');
Also, use strcmp() to compare strings, not "="
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!