Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The FORTRAN program of calculating the Fibonacci numbers is shown below [1]: PROGRAM fbnc c Fibonacci sequence integer f1,f2,f3 f1=1 f2=1 write(*,*)'To display Fibonacci numbers.'

The FORTRAN program of calculating the Fibonacci numbers is shown below [1]:

PROGRAM fbnc

c

Fibonacci sequence

integer f1,f2,f3

f1=1

f2=1

write(*,*)'To display Fibonacci numbers.'

write(*,*)'Enter the number of terms to be displayed:'

read(*,*)n

write(*,*)'The Fibonacci sequence is : '

IF(n.EQ.1)THEN

write(*,10)f1

10

format(1x,I6)

ELSE

write(*,10)f1

write(*,10)f2

DO 20 i=3,n

f3=f1+f2

write(*,10)f3

f1=f2

f2=f3

20

continue

ENDIF

STOP

END

  1. Identify all operators (including the End-Of-Statement EOS operators, ) and their frequencies. Put operators names and their frequency values in Table 1below:

TABLE 1: Operators and their Frequencies

No.

Operator

Frequency, f1

Based on this data (from Table 1), estimate total number of unique operators, n1, and the total number of operators appearance, N1:

n1 =

N1 = SUM(f1) =

  1. Identify all operands and their frequencies. Put operands names and their frequency values in Table 2 below:

TABLE 2: Operands and their Frequencies

No.

Operand

Frequency, f2

Based on this data (from Table 2), estimate total number of unique operands, n2, and the total number of operands appearance, N2:

n2 =

N2 = SUM(f2) =

  1. Following the Halsteads metrics definitions [2-3], estimate the following metrics:

The program length (N): N = N1 + N2

The vocabulary size (n): n = n1 + n2

The program volume (V): V = N * log2(n)

The difficulty level or error proneness (D) of the program: D = ( n1 / 2 ) * ( N2 / n2 )

The program level (L): L = 1 / D

The effort to implement (E) or understand a program: E = V * D

The time to implement or understand a program (T): T = E / 18

The number of delivered bugs (B): B = ( E^(2/3) ) / 3000 (here the symbol ^ stands for "to the exponent")

  1. Make comments on estimates of implementation of this algorithm in any other programming language that you are familiar with.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions

Question

Why could the Robert Bosch approach make sense to the company?

Answered: 1 week ago