how to write a program combininb name and age?
古いコメントを表示
In my HB I got an assigment on writing a program that asks for the name and age of a person, then runs the sentence Dear__your age is___, the blank spaces containing the input
I thought about using a switch, the cases being the name inputs, is that something I can do or is there an easier way?
回答 (1 件)
Fangjun Jiang
2024 年 8 月 13 日
移動済み: Fangjun Jiang
2024 年 8 月 13 日
No Switch statement is needed. This practice is to get the input and put it in the right format.
help input
help sprintf
1 件のコメント
Steven Lord
2024 年 8 月 13 日
Another approach could be to build up a string that includes your data. This documentation page shows two ways to do that.
カテゴリ
ヘルプ センター および File Exchange で Whos についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!