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 threehouseholds (address, type of vehicle, yearly income, and number of children), storethe information in an array of Households, and compute and output the

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!