程序代写 EECS2501 E – Fortran and Scientific Computing (Fall 2022-2023) / Quizzes /

2022/11/28 下午5:10 Quiz02-Nov07: Attempt review

https://eclass.yorku.ca/mod/quiz/review.php?attempt=4007284&cmid=1922366 1/11

Copyright By PowCoder代写 加微信 powcoder

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%)

https://eclass.yorku.ca/my/
https://eclass.yorku.ca/course/view.php?id=76113
https://eclass.yorku.ca/course/view.php?id=76113#section-4
https://eclass.yorku.ca/mod/quiz/view.php?id=1922366

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

Mark 6.50 out of 6.50

Program Program01
implicit none
integer::n
Print*, ‘Enter an integer number >1’
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’
print ‘(a,i3,a,i4)’, ‘hanoi number of ‘,n,’ is:’,TOH(n)

recursive function TOH(n) result(result)
integer::n,result
if (n > 1) then
result = 2 * TOH(n – 1) + 1
else if(n==1) then
Print*, ‘out of range’
end function TOH
end program Program01

Program01.f95

https://www.onlinegdb.com/online_fortran_compiler
https://www.nsc.liu.se/~boein/f77to90/a5.html
https://gcc.gnu.org/onlinedocs/gfortran/
https://eclass.yorku.ca/pluginfile.php/4341530/question/response_attachments/4310612/1/171845783/Program01.f95?forcedownload=1

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:

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

A solution is:

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

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.

https://eclass.yorku.ca/pluginfile.php/3504987/question/questiontext/4310612/2/49950890/Problem2_input.txt
https://www.onlinegdb.com/online_fortran_compiler
https://www.nsc.liu.se/~boein/f77to90/a5.html
https://gcc.gnu.org/onlinedocs/gfortran/

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

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.

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

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

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.

https://eclass.yorku.ca/pluginfile.php/3504987/question/questiontext/4310612/3/49950891/Program03.f95
https://www.onlinegdb.com/online_fortran_compiler
https://www.nsc.liu.se/~boein/f77to90/a5.html
https://gcc.gnu.org/onlinedocs/gfortran/

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

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

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

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…

https://eclass.yorku.ca/mod/quiz/view.php?id=1875238&forceview=1

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com