Lab 3: Calculate Depreciation

Name _____________________                  Student ID___________________

Purposes
  1. be familiar with basic Fortran programming concepts.
  2. practice the four step problem solving process.
  3. practice the basic Fortran programming using an example program.
  4. practice the compile and execution process.

Problems - Page 114, problem 19.

Requirement

1. Complete the pre-lab exercises (in next page) before you entering in the lab. Help is available during the tutoring hours and office hours.

2. In the lab time, follow the In-Lab instruction to finish the lab practice. Record the required information as lab report.

3. Demo your lab program for the instructor or the TA. Submit your pre-lab exercise and the lab report.



Pre-Lab Exercise

1.
Analyze the problem and write down the specification of the problem, including the input and output.

What is the problem?


What is the input information?
How many variables needed to represent them? List the name and type for each variable.

What is the output information?
How many variables needed to represent them? List the name and type for each variable.

Are there additional variables needed to solve the problem?
List the name and type for each additional variable.













2. What is the step-by-step procedure to solve this problem? Draw a flow chart to represent this procedure.

























3. In this lab, you need create a new program from scratch.  Write down a draft of the program in the following table. Use the programs in lab 1 and 2 or other programs in the textbook as examples.

Heading PROGRAM program-name

Comments
  • program purpose
  • all variable names and meaning
  • input and output



                                                                                                                         
Specification
Declare all vaiables.

Type-specifier :: list









Execution part
Get input information.
Do caclulation.
Display output information.







































Ending
END PROGRAM program-name






















In-Lab Instruction


1. Create a new folder lab3 in CIS261, use this folder to save files for this lab.

2. Implement the program coding from scratch. You need create a new file using NotePad for this program.

3. Compile and execute the modified program, test it with two groups of  input data, write down the input  data and the output results in the table below.


Variable name
Test 1
Test 2
Input
V0
50000


R
0.12


N
5

Output
Vaule at Year 1



Vaule at Year 2



Vaule at Year 3



Vaule at Year 4



Vaule at Year 5