UNIPORT CSC 280: Answers to Introduction to Computer Programming (Modern FORTRAN) Practical Workbook Part III
CSC 280 Answers to Practical Workbook – Introduction to Computer Programming, Modern FORTRAN Language Programs – CSC 280 is a course from Department of Computer Science, Faculty of Science in the University of Port Harcourt as well as other Universities. It is offered as borrowed course by other departments to enable them have the knowledge of programming. Though, it was introduced to the University as GES 101 – Computer Appreciation and Application.
In this course, ForTran – Formula Translator language is obeyed. Students are expected to run the programmes using Plato FORTRAN Application.
The objective of the course is that, students will learn how to run programmes on their own before semester ends. Thus, the initiation of the course in the University.
To pass this course is very easy as you are very lucky to come across this article. You must fill your manual or workbook very well. You can use download the PDF of the ones we have filled to fill yours. Also, you are required to do well in your Test then your exams.
Lab 25: Reading an Array 1
Algorithm
- Declare all variables
- Supply value less than 10 to n
- Do i = 1, n
Supply values to array X
End do
- Print the values each that has stored in array X
Observations/Output
Observation: The program declares one dimensional array called a size that is less than or equal to and stores random integer values. The array depending on the size of the array.
Output:
Let n = 3
40
10
60
Lab 26: Reading an Array 2
Algorithm
- Declare all variables
- Declare the size of the array
- Supply values to the array using a shorthand form
- Display the values stored in the array
Observations/Output
Observation: In the program and their form of supplying values to arrays was used instead of the usual do loop
Output:
Let n = 3
40
10
60
Lab 27: Reading values into a Matrix
Algorithm
- Declare all variables including the two-dimensional array
- Supply values to ml and n1
- Supply values to elements of two-dimensional array
- Display result of the elements stored in the two-dimensional array.
Observations/Output
Observation: The name of the program is Matrix. A constant variable with value is declared as integer. (i.e. max = 5). A nested do loop is used in the program to supply values to a two-dimensional array and to display the values stored in the array.
Output:
If m1=2, n1 = 2
4
6
0
3
Lab 28: Sorting –Bubble Sort
Aim: Write a program to sort the elements of an array using bubble sort algorithm.
ALGORITHM
- Declare variables and array
- Enter the total number to be sorted
- Supply values to be sorted
- Sort the element of the array
OBSERVATION/OUTPUT
Observation: the name of the program is sort and it sorts numbers in ascending order. An array called list was declared with maximum size of 100. After values have been supplied to the array then the program sort the values in ascending order.
Output: if actualize = 2, then, the operation will be carried out. We may have
33 40
As the output if we supply 40 and 33 as the elements of the array lists.
Functions, subroutines and data transfer
Lab 29: Fahrenheit to Celsius Conversion
Algorithm
- Declare all variables
- Assign value to ftempt
- Call function to calculate the temperature to Celsius
- Display result
Observations/Output
Observation: The program converts a temperature value in Fahrenheit to Celsius
Output:
To convert a Fahrenheit, temperature 37.000 to Celsius temperature is 2.77778
Lab 29: Fahrenheit to Celsius Conversion
Algorithm
- Declare all variables
- Assign value to ftempt
- Call function to calculate the temperature to Celsius
- Display result
Observations/Output
Observation: The program converts a temperature value in Fahrenheit to Celsius
Output:
To convert a Fahrenheit, temperature 37.000 to Celsius temperature is 2.77778
Lab 29: Fahrenheit to Celsius Conversion
Algorithm
- Declare all variables
- Assign value to ftempt
- Call function to calculate the temperature to Celsius
- Display result
Observations/Output
Observation: The program converts a temperature value in Fahrenheit to Celsius
Output:
To convert a Fahrenheit, temperature 37.000 to Celsius temperature is 2.77778
Lab 30: Sum of Four Numbers
Algorithm
- Declare all variables
- Supply values to variables
- Call function to calculate the sum
- Display the result
Observations/Output
Observation: The program calculates the sum of four real numbers using function
Output:
The sum of four numbers is 155.820
Lab 31: Area of a circle
Algorithm
- Declare all variables
- Assign values to radius
- Call function to calculate area of circle
- Display the result
Observations/Output
Observation: The program contains a function which calculates the area of a circle. Variable was declared in the function.
Output:
The area of the circle with radius 3.8 is 45.3416
Lab 34: Subroutine – Area of a triangle
Algorithm
- Declare all variables
- Call subroutines and write out the formula
- Display the result
Observations/Output
Observation: The name of the program is AreaTriangle. It calculates the area of a triangle gives Lside, Wside, Bside. A subroutine was included in the program to perform the calculatin.
To be updated on all Uniport Materials for Examination and Sure Questions
Subscribe to this site using your Email address for FREE
LIKE our Facebook page for updates
FOLLOW our Twitter Handle for updates