CS1001 - D Term, 1998
Laboratory 2 - Boolean Expressions
Date: March 29,2000
.NOT. ( (A .GT. 5 ) .AND. .NOT. (B .GE. 7))
Write your logical expression here so you can refer to it as you complete this lab exercise:
On a separate piece of paper, put your name, login name, and section number, and write down the logical expression again. Pass the paper in to the TA.
Write a program to show that the given expression and your expression are equivalent. Your program should be structured as follows:
read in value for an integer variable A read in value for an integer variable B IF (.NOT. (A .GT. 5) .AND. .NOT. (B .GE. 7)) THEN print *, 'TRUE' ELSE print *, 'FALSE' ENDIF IF (your equivalent expression) THEN print *, 'TRUE' ELSE print *, 'FALSE' ENDIF
TRUE TRUEor
FALSE FALSEGenerate a script file that contains sample executions of your program. The script file should show enough sample runs to demonstrate the equivalence of your two logical expressions. (Hint: you should show at least four sample runs to prove that the two expressions are equivalent; Why four? Choose your values for A and B carefully.)
/cs/bin/turnin submit cs1001 lab2 lab2.f90 lab2.script
See you next week!
This document was generated using the LaTeX2HTML translator Version
97.1 (release) (July 13th,
1997)
Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer
Based Learning Unit,
University of Leeds.
The command line arguments were:
latex2html lab2.tex.
Nitin John
3/28/2000