Numerical Methods for Engineers(엔지니어를 위한 수치해석) 5판 솔루션 Chapra,Canale 저 2002. 11. 30 ch2 ~ 31장까지 있습니다.
IF x < 10 THEN IF x < 5 THEN x = 5 ELSE PRINT x END IF ELSE DO IF x < 50 EXIT x = x - 5 END DO END IF
2.2 Step 1: Start Step 2: Initialize sum and count to zero Step 3: Examine top card. Step 4: If it says “end of data” proceed to step 9; otherwise, proceed to next step. Step 5: Add value from top card to sum. Step 6: Increase count by 1. Step 7: Discard top card Step 8: Return to Step 3. Step 9: Is the count greater than zero? If yes, proceed to step 10. If no, proceed to step 11. Step 10: Calculate average = sum/count Step 11: End 2.3
sum = 0 count = 0
count > 0 INPUT value F
average = sum/count value = “end of data” F sum = sum + value count = co…(생략)
unt + 1 T
2.4 Students could implement the subprogram in any number of languages. The following Fortran 90 program is one example. It should be noted that the availability of complex variables in Fortran 90, would allow this subroutine to be made even more concise. However, we did not exp