2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 1/11
Dashboard / My courses / LE/EECS2501 E - Fortran and Scientific Computing (Fall 2022-2023) / Quizzes / Quiz02-Nov07
Started on Monday, 7 November 2022, 5:30 PM
State Finished
Completed on Monday, 7 November 2022, 7:00 PM
Time taken 1 hour 29 mins
Grade 6.50 out of 25.00 (26%)
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 2/11
Question 1
Complete
Mark 6.50 out of 6.50
Program Program01
implicit none
integer::n
Print*, 'Enter an integer number >1'
read*, n
print '(a,i3,a,i4)', 'hanoi number of ',n,' is:',TOH(n)
end program Program01
For an online Fortran compiler click here. A list of Fortran90 intrinsic functions can be found here or here.
Program Program01
implicit none
integer::n
Print*, 'Enter an integer number >1'
read*, n
print '(a,i3,a,i4)', 'hanoi number of ',n,' is:',TOH(n)
contains
recursive function TOH(n) result(result)
integer::n,result
if (n > 1) then
result = 2 * TOH(n - 1) + 1
else if(n==1) then
result=1
else
Print*, 'out of range'
end if
end function TOH
end program Program01
Program01.f95
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 3/11
A solution is:
Rubric:
6.5/6.5: Function works fine
5.0/6.5: Function is Ok, but code is not compiled due to a minor error.
3.0/6.5: Code is compiled, but the function does not work correctly and has miscalculations.
1.5/6.5: Function has a correct algorithm/structure but is not compiled due to errors.
0.5/6.5: Function has very few commands, less than 25% complete
0.0/6.5: no/irrelevant submission
Comment:
A solution is:
Rubric:
6.5/6.5: Function works fine
5.0/6.5: Function is Ok, but code is not compiled due to a minor error.
3.0/6.5: Code is compiled, but the function does not work correctly and has miscalculations.
1.5/6.5: Function has a correct algorithm/structure but is not compiled due to errors.
0.5/6.5: Function has very few commands, less than 25% complete
0.0/6.5: no/irrelevant submission
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 4/11
Question 2
Complete
Mark 0.00 out of 8.50
Right Click on Problem2_input.txt to download it.
For an online Fortran compiler click here. A list of Fortran90 intrinsic functions can be found here or here.
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 5/11
A solution is:
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 6/11
Rubric:
8.5/8.5: Code works perfectly
-1.5: if Code does not do the keyboard entry task (lines9-13) correctly.
-2.5: if code does not declare/assign each vector (V or U) correctly
-1.5: If code does not print the vectors on the screen correctly.
-1.5: If code does not do the line34 task correctly.
-1.5: If code does not do the line35 task correctly.
Comment:
A solution is:
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 7/11
Rubric:
8.5/8.5: Code works perfectly
-1.5: if Code does not do the keyboard entry task (lines9-13) correctly.
-2.5: if code does not declare/assign each vector (V or U) correctly
-1.5: If code does not print the vectors on the screen correctly.
-1.5: If code does not do the line34 task correctly.
-1.5: If code does not do the line35 task correctly.
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 8/11
Question 3
Complete
Mark 0.00 out of 10.00
Right Click on Program03.f95 to download the program below. Modify the program and upload it.
For an online Fortran compiler click here. A list of Fortran90 intrinsic functions can be found here or here.
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 9/11
A solution is:
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 10/11
Rubric:
10/10: function works correctly
-1.5 function has only one minor error
-5to-7 function works but with miscalculation
-2 function does not process the out-of-range NAN error
-8 function is developed less than 50%, or has some errors
-10 no/irrelevant submission
Comment:
A solution is:
2022/11/28 下午5:10 Quiz02-Nov07: Attempt review
https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 11/11
Rubric:
10/10: function works correctly
-1.5 function has only one minor error
-5to-7 function works but with miscalculation
-2 function does not process the out-of-range NAN error
-8 function is developed less than 50%, or has some errors
-10 no/irrelevant submission
◄ Quiz01-Oct03
Jump to...