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.
Contents
You may be asked to run program to calculate:
Program Average5
Real :: a, b, c, d, e
Real :: sum
Real :: avg
Write (*’*) ‘Enter the five numbers, Press the ENTER key after each number’
Read (*’*) a, b, c, d, e
Sum = a + b + c + d + e
Avg = sum/5
Write (*’*) ‘The average of the five numbers :’, avg
End Program Average5
Observations/Output
Observation: The name of the program is ‘Hello’. The keywords such as ‘program’, ‘implicit none’, ‘write’ and ‘End program’ coloured blue. The text to the right of the exclamation mark is a comment.
Output: Hello World
Algorithm
Observations/Output
Observation: The name of the program is ‘Swap’. The aim of this program is to move the value in variable a to be and vice versa. This is achieved by declaring the variable to perform the swapping of values.
Output: If a = 5, b = 6. The output will be: 6 5
Algorithm
Observations/Output
Observation: The program calculate the area of a circle given the radius. A constant pie was declared to be a real constant.
Output: Given that R = 6.
The area of the circle write radius 6 is 113.112
Algorithm
Observations/Output
Observation: The program calculates the sum and average of the five values supplied during the experiment.
Output: Let a = 1, b =3, c = 5, d = 7, e = 9.
The average of the five numbers = 5.00000
Algorithm
Observations/Output
Observation: The program calculates the area of a sector of a circle given the radius and the angle of the sector. The name of the program is AreaSector.
Output: Let radius = 4, angle = 60
Radius = 4.000000, Angle of Sector = 60.00000
Area of sector = 8.37866
Algorithm
Observations/Output
Observation: The program calculates the area of a triangle given the three sides (a, b and c)
Output: Let a = 4, b = 5, c = 6.
The area of the triangle with sides 4cm, 5cm and 6cm is 9.92157cm square
Algorithm
Observations/Output
Observation: The name of the program is vertical. It calculates the vertical motion under gravity.
Output: Let t = 2, u = 10.
Time = 2, Displacement = 0
Algorithm
Observations/Output
Observation: The name of the program is QuadEqn1. The program calculates the roots of a quadratic equation given value of a, b and c.
Output: If a = 1, b = 5, c = 6.
Roots are – 2.000000 and – 3.000000
Algorithm
If i is less than 5 then sum = sum+1
If i is less than 10 then sum = sum+2
If i is less than 15 then sum = sum+3
Increase i by 3. i.e. i= i+3
End do
Observations/Output
Observation: The name of the program is summvalues. In the program, if-control structure is used to test the value of i and execute any of them if statements in the program.
Output:
1
2
4
9
10
Algorithm
Observations/Output
Observation: The name of the program is vertical. It calculates the vertical motion under gravity.
Output: Let t = 2, u = 10.
Time = 2, Displacement = 0
Algorithm
Else
If b < a and b < c then b is minimum
Else
C is minimum
Observations/Output
Observation: The program compares three numbers to three numbers to determine the minimum and display the result. The name of the program is Minimumval. In the program, IF… THEN… ELSE… END IF Construct was used, also, the logical operator ‘A’. was also, the logical operator to combine logical expression or condition.
Output: If a = 5, b = 10, c = 8.
The output will be:
The minimum of the three numbers is 5
Algorithm
Else
The roots are complex
Observations/Output
Observation: The program calculates the roots of a quadratic equation given values of a, b and c. It also tests if the discriminant (d) of the equation to know it is greater than zero, so that the roots are real roots. Else the roots are complex roots and cannot be calculated.
Output: If a = 1, b = 5, c = 6.
Discriminant = 1.000000
Algorithm
Else if speed > 35 then fee = 2000
Else if speed > 50 then fee = 4000
Else fi speed > 65 then fee = 6000
Observations/Output
Observation: The name of the program is checkSpeedFee. The program calculates speed fee given them in kilometers per hour.
Output: If Speed = 75Km/hr
The output will be:
Pay a fee of 6000 Naira for a Speed of 75 Km/hr.
If you need Part II of this workbook, kindly Click Here
Subscribe to this site using your Email address for FREE
LIKE our Facebook page for updates
FOLLOW our Twitter Handle for udpates
NYSC Batch C Stream 2 2024 Update | Online Registration Starting Date, Mobilization and Camp…
Nigerian Army (NA) 88RRI Recruitment 2024/2025 Application Form Portal - Do you want to apply…
Chief Security Officer (CSO) at United Nigeria Airlines: How to Apply: United Nigeria Airlines is…
Safety and Quality Manager at United Nigeria Airlines - Apply Here: I am directed to…
NYSC Corps Members Allowance - DG Gives Assurance of Stipend Hike This article is directed…
How To Check If Your FG Loan Application Status Is Verified: As the Federal Government…