Education Tips

UNIPORT CSC 280: Answers to Introduction to Computer Programming (Modern FORTRAN) Practical Workbook Part III

Spread the love

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

  1. Declare all variables
  2. Supply value less than 10 to n
  3. Do i = 1, n

Supply values to array X

End do

  1. 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

  1. Declare all variables
  2. Declare the size of the array
  3. Supply values to the array using a shorthand form
  4. 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

  1. Declare all variables including the two-dimensional array
  2. Supply values to ml and n1
  3. Supply values to elements of two-dimensional array
  4. 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

  1. Declare variables and array
  2. Enter the total number to be sorted
  3. Supply values to be sorted
  4. 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

  1. Declare all variables
  2. Assign value to ftempt
  3. Call function to calculate the temperature to Celsius
  4. 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

  1. Declare all variables
  2. Assign value to ftempt
  3. Call function to calculate the temperature to Celsius
  4. 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

  1. Declare all variables
  2. Assign value to ftempt
  3. Call function to calculate the temperature to Celsius
  4. 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

  1. Declare all variables
  2. Supply values to variables
  3. Call function to calculate the sum
  4. 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

  1. Declare all variables
  2. Assign values to radius
  3. Call function to calculate area of circle
  4. 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

  1. Declare all variables
  2. Call subroutines and write out the formula
  3. 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

UNIPORT CSC 280: Answers to Introduction to Computer Programming (Modern FORTRAN) Practical Workbook Part III

basedonnews

Share
Published by
basedonnews

Recent Posts

NYSC Batch C Stream 2 2024 | Online Registration Starting Date, Mobilization and Camp Date

NYSC Batch C Stream 2 2024 Update | Online Registration Starting Date, Mobilization and Camp…

2 weeks ago

Nigerian Army (NA) 88RRI Recruitment 2024/2025 Application Form Portal

Nigerian Army (NA) 88RRI Recruitment 2024/2025 Application Form Portal - Do you want to apply…

3 weeks ago

Chief Security Officer (CSO) at United Nigeria Airlines: How to Apply

Chief Security Officer (CSO) at United Nigeria Airlines: How to Apply: United Nigeria Airlines is…

2 months ago

Safety and Quality Manager at United Nigeria Airlines – Apply Here

Safety and Quality Manager at United Nigeria Airlines - Apply Here:  I am directed to…

2 months ago

NYSC Corps Members Allowance – DG Gives Assurance of Stipend Hike

NYSC Corps Members Allowance - DG Gives Assurance of Stipend Hike This article is directed…

2 months ago

How To Check If Your FG Loan Application Status Is Verified

How To Check If Your FG Loan Application Status Is Verified: As the Federal Government…

2 months ago