Some of the intrinsic functions given in class (see September 18 notes) will be helpful in this assignment.
Determine if this segement works as intended (note, don't write a program to test this, just mentally trace through the logic using a few different values for temp.) Does the program segment work as intended?
If the program segment does not work as intended, re-write the IF-THEN block so that it works properly, then write a complete program. Test your program using values for temp that will ensure that each branch of the IF-THEN block is being accounted for.
IF(temp < 97.5d0) THEN WRITE(*,*) 'Temperature below normal' ELSEIF(temp > 97.5d0) THEN WRITE(*,*) 'Temperature normal' ELSEIF(temp > 99.5d0) THEN WRITE(*,*) 'Temperature slightly high' ELSEIF(temp > 103.0d0) THEN WRITE(*,*) 'Temperature dangerously high' ENDIF
|Weight (lbs)||Cost ($)|
|0.00 - 2.00||$10|
|2.01 - 5.00||$20|
|5.01 - 10.00||$40|
|10.01 - 20.00||$60|
|20.01 - 40.00||$80|
|40.01 - 75.00||$100|
|> 75.01||Can't be shipped|
Write an F90 program that will ask the user to input a weight, then print out the shipping cost. Select your own test cases that will ensure each branch is working correctly.
If the point P(x,y,z) is inside the sphere with center (2,3,-5) and radius 1.1, the program should display the message 'Inside Sphere 1'
If the point P(x,y,z) is inside the sphere with center (3,1,-4) and radius 0.5, the program should display the message 'Inside Sphere 2'
For any other case, the program should display the message 'Point not in any sphere'
Test your program using the points (3.25,1.1,-3.9), (2.1,3.1,-4.8) and (10,10,-10). You can assume that a point can only be in one of the spheres.