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)

A

tangent

17
Q

atan(x)

A

arctangent

18
Q

abs(x)

A

absolute value

19
Q

sqrt(x)

A

square root

20
Q

exp(x)

A

e^x

21
Q

log(x)

A

log base 10 of x

22
Q

Are trigonometric functions calculated in radians or degrees?

A

radians

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

==

A

equal to

25
Q

=

A

assignment of value

26
Q

if, else, endif

A
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
Q

/=

A

not equal to

28
Q

<

A

less than

29
Q

<=

A

less than or equal to

30
Q

>

A

greater than

31
Q

> =

A

greater than or equal to

32
Q

.and.

A

combine two “if ( ) then” statements

33
Q

.or.

A

combine two “if ( ) then” statements

34
Q

stop

A

command stops the program

35
Q

do i=0,20

A

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
Q

do i=50,70,2 !What is “2” in this line?

A

2 is the increment step

37
Q

translate: x=x+1.0

A

Add 1.0 to the value currently stored in memory location”x” and then store the result in memory location “x.”

38
Q

mod

A

“mod” returns the remained of the first argument divided by the second.

39
Q

What is the number of decimal precision for “single precision”?

A

6