FORTRAN Flashcards

1
Q

!text

A

Comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

print *, ‘text’

A

Outputs ‘text’ to the screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

*

A

means use the default number of decimal places when the number is written to the screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the significance of ‘implicit none’

A

By including it in your program, FORTRAN will check that you have properly declared all your variable types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Translate: x=2

A

store the value “2” in memory location “x”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Translate: y=3

A

store the value “3” in memory location “y”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Translate: z=x+y

A

Add the values stored in memory location “x” and “y” and store the result in memory location “z”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How many variable names can be on the left hand side of an equals sign

A

One!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

+ , -

A

plus and minus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  • , /
A

multiply and divide

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

**

A

exponentiation (raise to the power)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

( )

A

brackets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Does FORTRAN follow the order of operations?

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

sin(x)

A

sine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

cos(x)

A

cosine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

tan(x)

17
Q

atan(x)

A

arctangent

18
Q

abs(x)

A

absolute value

19
Q

sqrt(x)

A

square root

20
Q

exp(x)

21
Q

log(x)

A

log base 10 of x

22
Q

Are trigonometric functions calculated in radians or degrees?

23
Q

if … end if

A
if (condition is true) then
    execute this line
    and this
    and so on until we get to ...
end if
24
Q

==

25
=
assignment of value
26
if, else, endif
``` if (choice == 1) then do something else if (choice == 2) then do something else else do this if nothing else satisfies the conditions end if ```
27
/=
not equal to
28
<
less than
29
<=
less than or equal to
30
>
greater than
31
>=
greater than or equal to
32
.and.
combine two "if ( ) then" statements
33
.or.
combine two "if ( ) then" statements
34
stop
command stops the program
35
do i=0,20
i is called a loop counter. each time the statements are executed,t he loop counter, i, is incremented by 1. When the value of i is 20, the loop terminates, and the program resumes after the end do.
36
do i=50,70,2 !What is "2" in this line?
2 is the increment step
37
translate: x=x+1.0
Add 1.0 to the value currently stored in memory location"x" and then store the result in memory location "x."
38
mod
"mod" returns the remained of the first argument divided by the second.
39
What is the number of decimal precision for "single precision"?
6