Lab Activity #4
Let
f(x) = 2x-3 for x < -1, (2/3)x-1 for x = -1, (3/7)x-2 for x > -1,
and let
g(x)=(-6/7)x for x >= 3, 0.5x-1 for x < 3.
Write, run, and test a Fortran 90 program which computes (fog)(x), where (fog)(x)=f(g(x)).
Input: x, where x is any real number.
Output: (fog)(x).
Here is a sample run (your program should do exactly the same thing):

======== Sample run starts here. ========

Enter your value of x:

-2.0

(fog)(-2.0)=-7.0.

======== Sample run ends here. ========

  • You should only use the material which we covered by Sep., 8.
  • DO NOT forget to run and test your program. Also, make sure that it has no logical errors (i.e. it gives you right answers.)

    Back to the top

    Back to the CSCE 150 page

    Iyad Abu-Jeib's Homepage