Question: The following Fortran program was written to read information for three households (address, type of vehicle, yearly income, and number of children), store the information



The following Fortran program was written to read information for three households (address, type of vehicle, yearly income, and number of children), store the information in an array of Households, and compute and output the address of the households that have a greater than average number of children. Order the lines below to complete the program. PROGRAM Households IMPLICIT NONE TYPE Household CHARACTER (Len=30) :: address, vehicle REAL :: income INTEGER :: children END TYPE Household INTEGER::i, j, sum=0 INTEGER, PARAMETER :: num=3 REAL :: avg ! Ordered statements go here END PROGRAM Households END IF READ(*,*) array(i)%children END DO!j loop END DO ! i loop IF (array(j)%children > avg) THEN TYPE(Household) :: array(num) 1 avg = sum/REAL(num) READ(*,(A)') array(i)%address DO i=1, num WRITE(*,*) 'Enter the address, vehicle, income, and # of children' DO j=1, num READ(*,*) array(i)%income > sum=sum+array(i)%children > WRITE(*, *) array()%address The following Fortran program was written to read information for three households (address, type of vehicle, yearly income, and number of children), store the information in an array of Households, and compute and output the address of the households that have a greater than average number of children. Order the lines below to complete the program. PROGRAM Households IMPLICIT NONE TYPE Household CHARACTER (Len=30) :: address, vehicle REAL :: income INTEGER :: children END TYPE Household INTEGER::i, j, sum=0 INTEGER, PARAMETER :: num=3 REAL :: avg ! Ordered statements go here END PROGRAM Households END IF READ(*,*) array(i)%children END DO!j loop END DO ! i loop IF (array(j)%children > avg) THEN TYPE(Household) :: array(num) 1 avg = sum/REAL(num) READ(*,(A)') array(i)%address DO i=1, num WRITE(*,*) 'Enter the address, vehicle, income, and # of children' DO j=1, num READ(*,*) array(i)%income > sum=sum+array(i)%children > WRITE(*, *) array()%address
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
