C This program queries the user about four preferences. C Logical variables are set based on each response. If the user C likes coastal areas and big cities or arid and warm climates, C one print statement is generated. If that condition isn't true, C a different statement is printed. C C John Schneider C CptS 203, HW 3, problem 2 C-------------------------------------------------------------------------- program places implicit none integer choice logical coast, big, warm, arid C..... C Query the user for each of four preferences. Use an integer C variable to read the response and then set a logical variable C appropriately. If the user gives an inappropriate response, C terminate the program. C..... print *, 'Do you prefer inland or coastal areas?', & ' (1=coast, 0=inland)' read *, choice if (choice .eq. 1) then coast = .true. else if (choice .eq. 0) then coast = .false. else stop end if print *, 'Do you prefer big cities or small towns?', & ' (1=big, 0=small)' read *, choice if (choice .eq. 1) then big = .true. else if (choice .eq. 0) then big = .false. else stop end if print *, 'Do you prefer warm or cool climates?', & ' (1=warm, 0=cool)' read *, choice if (choice .eq. 1) then warm = .true. else if (choice .eq. 0) then warm = .false. else stop end if print *, 'Do you prefer arid or humid climates?', & ' (1=arid, 0=humid)' read *, choice if (choice .eq. 1) then arid = .true. else if (choice .eq. 0) then arid = .false. else stop end if C..... C Based on the user's responses, print one of two statements. C..... if ((coast .and. big) .or. (warm .and. arid)) then print *, 'It shouldn''t be hard to find a place like that.' else print *, 'Good luck finding that place!' endif stop end