chapter_7 Module

All of the programming exercises for Chapter 7: Procedures



Contents


Subroutines

public subroutine p7_1()

DISCUSSION QUESTION
What is the difference between a subroutine and a function?

Arguments

None

public subroutine p7_2()

DISCUSSION QUESTION
When a subroutine is called, how is data passed from the calling program to the subroutine, and how are the results of the subroutine returned to the calling program?

Arguments

None

public subroutine p7_3()

DISCUSSION QUESTION
What are the advantages and disadvantages of the pass-by-reference scheme used in Fortran?

Arguments

None

public subroutine p7_4()

DISCUSSION QUESTION
What are the advantages and disadvantages of each procedure array type?

Arguments

None

public subroutine p7_5()

DISCUSSION QUESTION
Suppose a 15-element array is passed to a subroutine. What happens if the subroutine attempts to write to element a(16)?

Arguments

None

public subroutine p7_6()

DISCUSSION QUESTION
If a real value is passed to a subroutine in an argument that is declared to be an integer, what happens?

Arguments

None

public subroutine p7_7()

DISCUSSION QUESTION
How can p7_6 be modified so that the compiler catches the argument mismatch between the actual argument and the dummy argument in the subroutine?

Arguments

None

public subroutine p7_8()

DISCUSSION QUESTION
What is the purpose of the INTENT attribute? Where can it be used? Why should it be used?

Arguments

None

public subroutine p7_9()

NOT APPLICABLE

Arguments

None

public subroutine p7_10()

NOT APPLICABLE

Arguments

None