PROBLEM IN FORTRAN PROMLEM 1 The required 90 program reads a number of sets of v
ID: 3789871 • Letter: P
Question
PROBLEM IN FORTRAN
PROMLEM 1
The required 90 program reads a number of sets of values. The actual number of sets is read from the keyboard. Each set has less than 51 integer values, read from the keyboard, one per line. The actual number of values in a set is read from the keyboard. A pattern map is generated for each set of numbers where a value greater than zero is indicated by a ”P” , a zero by the character ”Z”, and a value less than zero by the character ”M”. This pattern is printed for each set of values as in the sample output below. (your program
output should match the sample output).A partial FORTRAN 90 program to accomplish the goals of this problem follows
Starting with the above partial code, complete the solution to this problem. DO NOT USE ANY VARIABLES BEYOND THOSE DECLARED. DO NOT ALTER THE PARTIAL CODE PROVIDED EXCEPT TO FILL IN YOUR INDIVIDUAL NAME IN THE PARTS BETWEEN THE ANGLE BRACKETS. USE INTEGER VARIABLES FOR ALL DO LOOP COUNTERS Submit test results for the following 4 sets (each on a line for convenience).
virabiles
2 5 3 -2 -4 -5 0 2 5
4 8 0 4 0 -3 -2 5
2 4 -6 7 -8 0
1 -5 3
!lab 20a solution by KSTUDENT NAME> program lab2 a implicit none character (50) line integer i,j,n, ma, val. print Lab 20a) solution by KSTUDENT NAME print Enter number of sets of values to read from keyboard read do i-1,n print enter number of values for set print must be leaa than 51 read *,m print enter .a. integer values one per line" do end do print Patte for aet ,i," ia: print *,line end doExplanation / Answer
program arrayDotProduct real, dimension(5) :: a, b integer:: i, asize, bsize asize = size(a) bsize = size(b) do i = 1, asize a(i) = i end do do i = 1, bsize b(i) = i*2 end do do i = 1, asize Print *, a(i) end do do i = 1, bsize Print *, b(i) end do Print*, 'Vector Multiplication: Dot Product:' Print*, dot_product(a, b) end program arrayDotProduct
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.