Does anyone know how to do problem 27 in chapter 6
조회 수: 2 (최근 30일)
이전 댓글 표시
The problem asks you to write a program in a script file that calculates the cost of shipping a package according to a table. It then says, the program asks the user to enter the type of service (Ground,Express, or Overnight) and the weight of the package (two numbers. First for number of pounds and second for number of ounces.) The program then displays the cost for the shipment. Run the program three times for the following cases: a.Ground 2 lb 7 oz. b. Express 0 lb 7 oz. c. Overnight 5 lb 10 oz.
댓글 수: 3
답변 (1개)
Image Analyst
2014년 11월 9일
Hints. the way I'd do it is to use a crude GUI-based approach rather than an even cruder command window-based approach. So I'd use these functions
- menu() - to get the type of service
- inputdlg() - to ask user for some numbers
- sprintf() - to create a string for displaying the result
- helpdlg() or msgbox() - to display the string.
There is help documentation on all of these, with examples I believe. Come back if you have any questions about your code.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!