Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

program sum real :: range_m real :: g real, dimension (1 : 5) :: v0 real, dimens

ID: 3677624 • Letter: P

Question

program sum
real :: range_m
real :: g
real, dimension (1 : 5) :: v0
real, dimension (1 : 17) :: theta
g=-9.81
v0 = (/ 0, 1, 10, 100, 1000 /)
theta = (/ 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85 /)
do i=1,5
do j=1,17
range_m = (-2*V0*(i)^2cos(tetha(j))sin(tetha(j)))/g
print *, range_m, " "
end do
print *, ""
end do
end program sum

please help, i got this error when i compile the above code. i don't undestand how to fix it

range_m = (-2*V0*(i)^2cos(tetha(j))sin(tetha(j)))/g

Error: Expected a right parenthesis in expression at (1)

Explanation / Answer

real :: range_m
real :: g
real, dimension (1 : 5) :: v0
real, dimension (1 : 17) :: theta
g=-9.81
v0 = (/ 0, 1, 10, 100, 1000 /)
theta = (/ 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85 /)
do i=1,5
do j=1,17
range_m = (-2*V0*(i)^2cos(tetha(j))sin(tetha(j)))/g
print *, range_m, " "
end do
print *, ""
end do
end program sum

Here range_m = ((-2*V0*((i)^2cos)*(tetha(j))*(sin(tetha(j))))/g)