!Author: Alexander Sage
!Homework 4
!Date: 10/19
!Purpose: to read in two vectors then take the dot product 

program chpt6
implicit none

integer :: i                          !defining a loup index
real :: d=0                           !initializing sum of the products at 0
real, dimension(3) :: a, b, c         !taking the dot product of a*b and getting c

write(*,*) "input a three dimension vector x, y, z"              !taking six values for two three 
read (*,*) a(1), a(2), a(3)                                      !dimensional vectors
write(*,*) "input the second three dimensional vector x, y, z"
read (*,*) b(1), b(2), b(3)

do i = 1, 3 
 c(i) = a(i)*b(i)                  !taking the product of each component of each vector respectively
!    write (*,*) i, c(i)   to test the individual numbers in the program
  d = d + c(i)                     !the sum of all the products
end do

write (*,*) "The dot product of the two three-dimensional vectors is =",  d

stop
end program chpt6