Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
115 views
CSC280 Preperatory Questions & Answers
Uploaded by
darrielabua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save CSC280 Preperatory Questions & Answers For Later
Download
Save
Save CSC280 Preperatory Questions & Answers For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
115 views
CSC280 Preperatory Questions & Answers
Uploaded by
darrielabua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save CSC280 Preperatory Questions & Answers For Later
Carousel Previous
Carousel Next
Download
Save
Save CSC280 Preperatory Questions & Answers For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
Preparatory Questions And Answers for CSC280.1 By EmmaRoyal UNIVERSITY OF PORT HARCOURT DEPARTMENT OF COMPUTER SCIENCE FIRST SEMSTERS EXAMS CSC 280.1: COMPUTER PROGRAMMING Use the program segment to answer question 1-4 Interger xy Integer, Dimension (3) 2 Data x.y.2(1),2(3)/2.4,5,2°6/ 1) The value assignedto array element 2(1) is (a)2_ (by (5 (d)6 (a) 12 2). The value assigned to y is ()2 “bya ()5 (dG (2) 12 3) The value assigned to 2(2) is (a2 (ba ()5.*(a) 6 (0) 12 4) The value assigned to 2(2) is (a2 (ea (5 *{a) 6 (0) 12 5) The of an array is an ordered list of its extents (a)Extent *(b) Shape (c)size (d) Dimension (e) Rank 6) Inznarray, the___ of the dimension is the number of element of the specified type in that dimension *(a}Extent (b) Shape (c)Size (d) Matrix (e) Rank 2) The symbol used to implement continuation in Fortran is (2) + (b)!(c) 1! a) & (e) 8) Which of the followingiis not a program debugging technique (a)Brute force (b) backtracking (c) Cause elimination (d) program slicing *(e) None of a,b,c or d 9) An Array with rank2 could be called__*{a)Matrix (b) List c) Subscribt (4) Vector (e) None of ab.cord 10) What contains the data and program during execution of the program by CPU? (a) ALU *(b) Primary Memory (cFlash drive (d) secondary memory (e) UPS For questions 11-14 classify each of the following as either integer constant, real constant, character constant, logical constant or Not Valid 11) RADIUS {a)integer (b) Real *(c) Character (d) Logical (e) Not Valid 12) “3.14159” _(alInteger *{b) Real (c} Character (d) Logical (e} Not Valid 13) False, {a)integer (b) Real (c) Character *(d) Logical (e) Not Vali¢ 14) "485" {alinteger (b) Real (c) Character (d) Logical *{e) Not Valid 15) Which of the following is a primary Fortran programming feature which supports parallel computing (a)Parallel array {b) Syne Array *(c) Coarrays (4) Jpint array (e) None of a,b,c ord 16) In activating a function in an expression, the function name is usually followed by list of Inputs called (a) arrays *(b) arguments (c) constructors (d}comments (e) None of a,b,c or d 17) **is an operator used to implement. in Fortran (a) Addition (bj Subtraction (c) Double Multiplication *(d) Exponentiation (e) None of a,b,c or d 18) Which of the following is NOT a loop construct in Fortran *(a) IF construct (b) Do While construct (c) Case Construct (d) Do Construct (e) None of a,b,c or d Use the following array declaration to answer questions 19-21 INTEGER, DIMENSION (2,3) :: CROSS 19) Array named CROSS has how many dimensions (a]1 *{b)2 (c) 3 (d) 4 (e) 6 20) The size of array CROSSis (a)1 (b)2 (c)3 (d) 4 *{e)6 24) The extent of array CROSS along dimension 2is (a)1 (b) 2 *(c)3 (d) 4 (e) 6 Use the following program segment to answer question 22-24 Integer, Dimension (3,3) :intmatrixPreparatory Questions And Answers for CSC280.1 By EmmaRoyal Doj-3 Intmatrix (hj) =2 End Do 22) By inspection, itis observed that the array named intmatrix is @ (2) 1-dimension array *(b) 2- dimension array (c) 3-dimension array (4) 4-dimension array (e) None of a,b,c or d 23) The Do loops are used to set the values of all the calls to *(a)2 (b) 3 (c) 4 (d) 6 (e)9 24) The size of Intmatrix is (a)2 (b) 3(c) 4 (d) 6 *e) 9 25) Determine the correct array declaration (a) integer, dimension (2,3) : john *(b) integer, dimension (2,3) :: john (0) dimension, integer(2,3) :john (d) dimension, integer(3,4): john (e) None of a,b,c or d 26) Which of the following statement is used to specify the size of an array _(a)array (b) integer *{c) dimension (a) write(e) range 27) Which of these Fortran keywords can be used to cause additional branching within @ Do-Loop (a)EXIT and JUMP (b) EXIT and BRANCH *(c) EXIT and CYCLE (4) JUMB and CYCLE (e) JUMP and BRANCH 28) Which ofthe following flow chart symbols isused to = data processing taf b. « a) wm £7 29) Which is the correct order in which operations are — in an expression, 2 bo © Ty 4 e| ” “ + " + ‘ 4 “ 7 30)__is an example of a input statement. *(a) READ (*,*) “SAM,PIE” (b) WRITE (*,") “SAM, PIE” (c) PRINT. (5) “SAM.PIE” (d) SEND (*,*) “SAM,PIE” (e) INPUT (*,*) “SAM, PIE" B1)A statement indicates exactly how data is laid out ina READ and WRITE statement. (a) FORTRAN (b) variable (c) expression (d) transform *(e) format 32) Which of the following is not a method for assignment values or populating an array? (a) Using Do Loop (b) Using Array Constructors (c) Assignment values to individual members of the array (4) Using array subscripts. *{e) None of ab,cord 33) An array with rank 2 could be called a___*(a)Matrix (b) Ust(c) Subscripts (d} Vectors (e] None of a,b,c or d 34) Which of the following is net a method for assigning values or populating an array (a) Using Do Loop (b) Using Array Constructors (c) Assignment values to individual members of the array (a) Using array subscripts . *(e) None of a,b,c or d For the following segments of FORTRAN code in questions 35-37, determine what values will be stored. 35) CHARACTER (Len=4) : SUB) SUBI= '0C3030° (a}0¢3030 *()0C30——_(c) 3030 (@) Error nothing will be stored (€) None of a,b,cor d 36) INTEGER: 1), KL 123, 128, Ke5; L=k41/3*42 40 (a1 (b)49 ()2_—(d)2.9__—_*Le) Error nothing will be stored 37) REAL:: CDF (C24; D=2 F=¢**2*1 1.06+03/2,0°D (a) 4000 _(b) -4000 (c) 1600 (4) -1600 *(e) Error nothing will be stored 38) The general format for array declaration in Fortran is *(a) Datatype, DIMENSION (a,b,c) :: arrayname (b) DIMENSION, datatype (a,b,c) :: arrayname (c) arrayname, DIMENSION (2,b,¢) :! Datatype (d) Datatype, arrayname:: DIMENSION (2,b,¢) (e) None of a,b,c or dPreparatory Questions And Answers for CSC280.1 By EmmaRoyal 39)_ statement is used to output data in Fortran, (a)FORMAT —(b)SEND-—*{c) WRITE (d) READ —_(e] Noneof a,b,c ord 40) What is the size of an array with DIMENSION (-4:2, 0:2)? (ay20 *(b) 21 (24 (a) 30 (e) None of a,b,c ord 41) an ordely arrangement of similar objects in rows and cclumns, in the form of a matrix, whose objects are of the same size and data type although the objects can have different values. (vector (b)Index—*{e)Array_—(d) Function __(e) None of a,b,cor d 42) In FORTRAN a numeric quantity in an expression that has a fixed value throughout the program is known as (a) Variable (b) Real *(q)Constant (d) Integer (e) String Use the program fragment below to answer question 43-45 Integer I Integer, Dimension (3) :(Maths DATA 1J Maths(2), Maths(2), Maths(3}, /5,3,6,2, 7/ 43) The Value assigned to array element Maths(3) fs (a2 (b)3 (c)5_-*(d)7_—_(e) None of a,b,cor d 44) The Value assigned to lis (a2 (b)3. * (eS (d)7_(e) None of ab,cord 43) The value assigned to Maths(2) is *fa)2_(b)3._(c)5_ (d)7_(@) None of a,b,c ord Use the following program fragment to answer questions 46-50 INTEGER =: TRACKER=4, FACTORIAL= 1 FACTORIAL = FACTORIAL *TRACKER; TRACKER = TRACKER-1. DO WHILE (TRACKER>0) FACTORIAL =FACTORIAL* TRACKER ; TRACKER = TRACKER ~ 1 END DO PRINT *, FACTORIAL 46) How many times will the DO WHILE loop be executed? *{a)3__(b) 4 (c)5_(d)6_(e) None of a,b,c ord 47) What value of TRACKER will terminate the loop? *{a)O_(b) 1 (c)2_(d) 73_(e) None of a,b,c ord 48) What is the final output value for FACTORIAL? (a) 120 (b) 240 (c) 360 (d) 720 *(e) None of a,b,cord 49) The variable TRACKER is declared as (a) integer constant *{b) integer variable (c) real constant _(d) real variable (e) None of a,b,c or d 50) The variable FACTORIAL is declared as *(a) integer constant _(b) integer variable (c) real constant (4) real variable — (e) None of a,b,cord SECTION B: Answer the two questions in the space provided. 1. Write a simple Fortran program to read 10 values into an array and then output the sum of the values. Make generous use of the comment statements to explain your program. 2. Write'a program using functions to calculate either the area OR the volume of a sphere using appropriate control constructs (Hints: Area of a Sphere = 4, Volume of a Sphere =4/3 ANSWER TO SECTION B 1. Program Sum_Array IThis program computes the sum of 10 values using arrays in Fortran Implicit None Real, Dimension (10) Real :: sum | declaration of variables Integer :i sum x dimension of the arrayPreparatory Questions And Answers for CSC280.1 By EmmaRoyal 10 !Beginning of the loop statement, Read (*,*) (i) linput statement to receive array elements ‘Sum= sum + x(i) !addition of array elements EndDo The end of the loop statement Write (*,*) The End of the loop statement End Program Sum_array Program Areafuncvol This program computes the area and volume of a sphere Using functions and control structures in Fortran Implicit None declaration of variables Integer ::selection Reels: Radius a,b ‘a= Areasphere(radius) b= Volumesphere(radius) ‘write (*,*) “please enter either 1 or 2” I1is to select Area of @ Sphere |2is to select Volume of a Sphere IF (selection ==1) Then ‘Write (*,*) “The Area of the sphere is”, a Else if (selection ==2) Then ‘write (*,*) “The Volume of the Sphere is” b Else Write (*,*) “invalid selection” End if Beginning of the Sub program part CONTAINS Function statement for Area of a Sphere REAL FUNCTION Areasphere (r) Implicit None {Declaration of variables Real:: Areasphere Real, intent (in) =r Real, parameter :: pi=3.142 Areasphere =4*pitr?*2 END FUNCTION Areasphere Ifunction statement for voume of a sphere REAL FUNCTION Volumesphere(r) IMPLICTT NONE !Declaration of variables Reels: Voumnesphere Rea,intent(in) :r Reel,parameter:: pi=3.142 Volumesphere =(4"pi*r?*3)/3 END FUNCTIONALVolumesphere End Program Areafuncvol
You might also like
Kakeibo Guide Template 2
PDF
100% (2)
Kakeibo Guide Template 2
9 pages
Introduction To Compiler Design - Solutions
PDF
0% (1)
Introduction To Compiler Design - Solutions
23 pages
Concentrix Placement Paper 1
PDF
No ratings yet
Concentrix Placement Paper 1
16 pages
Introduction To Cryptography: Homework 4: Alvin Lin January 2018 - May 2018
PDF
No ratings yet
Introduction To Cryptography: Homework 4: Alvin Lin January 2018 - May 2018
6 pages
How To Use SIC Simulator and Assembler
PDF
100% (2)
How To Use SIC Simulator and Assembler
12 pages
Key Values For Keyboard
PDF
100% (1)
Key Values For Keyboard
5 pages
Com113 Exams Ques 2023
PDF
No ratings yet
Com113 Exams Ques 2023
4 pages
CSC 201 Past Questions
PDF
No ratings yet
CSC 201 Past Questions
13 pages
U21CS601 MCQ Unit 123
PDF
No ratings yet
U21CS601 MCQ Unit 123
20 pages
C Language MCQ Bank PDF
PDF
0% (1)
C Language MCQ Bank PDF
11 pages
RSA
PDF
No ratings yet
RSA
12 pages
DSA_BCS304
PDF
No ratings yet
DSA_BCS304
29 pages
Gate CoA
PDF
No ratings yet
Gate CoA
137 pages
Assignment 1
PDF
100% (1)
Assignment 1
2 pages
Btech Cs 3 Sem Data Structure Kcs 301 2023
PDF
No ratings yet
Btech Cs 3 Sem Data Structure Kcs 301 2023
2 pages
MCS 012
PDF
No ratings yet
MCS 012
4 pages
Assembly Language For x86 Processors
PDF
No ratings yet
Assembly Language For x86 Processors
59 pages
Data Structures Viva Question Answers
PDF
No ratings yet
Data Structures Viva Question Answers
3 pages
DATABASE Short Questions With Answers
PDF
No ratings yet
DATABASE Short Questions With Answers
8 pages
Chapter 5 Exercise Solutions
PDF
100% (1)
Chapter 5 Exercise Solutions
9 pages
Cit308 Summary From Noungeeks
PDF
No ratings yet
Cit308 Summary From Noungeeks
87 pages
BC0034 Computer Concepts & C Programming Paper 1
PDF
No ratings yet
BC0034 Computer Concepts & C Programming Paper 1
13 pages
Course File Programming and Problem Solving in C
PDF
No ratings yet
Course File Programming and Problem Solving in C
10 pages
C Programming
PDF
No ratings yet
C Programming
4 pages
C Programming MCQ-2
PDF
No ratings yet
C Programming MCQ-2
5 pages
DDCO
PDF
No ratings yet
DDCO
34 pages
Mcs-012 Solved Assignment Ignou 2012
PDF
50% (2)
Mcs-012 Solved Assignment Ignou 2012
28 pages
Diffie-Hellman Key Exchange Man-in-the-Middle Attack Elgamal Cryptographic System
PDF
No ratings yet
Diffie-Hellman Key Exchange Man-in-the-Middle Attack Elgamal Cryptographic System
24 pages
6phrase - Myslate - Python - Session Plan
PDF
No ratings yet
6phrase - Myslate - Python - Session Plan
19 pages
Questions: Com 212introduction To System Programming 19/130936 ND Ii Stream A
PDF
No ratings yet
Questions: Com 212introduction To System Programming 19/130936 ND Ii Stream A
10 pages
BCS302 PYQS
PDF
No ratings yet
BCS302 PYQS
14 pages
MCS-021 2022 23 Solved Assignment
PDF
No ratings yet
MCS-021 2022 23 Solved Assignment
17 pages
Data Structure Lab Manual
PDF
No ratings yet
Data Structure Lab Manual
39 pages
File Allocation Methods
PDF
No ratings yet
File Allocation Methods
9 pages
Design and Implementation of Simple Scientific Calculator
PDF
No ratings yet
Design and Implementation of Simple Scientific Calculator
7 pages
Question Bank AAI
PDF
No ratings yet
Question Bank AAI
4 pages
Case Study: Using MongoDB For An E-Commerce Platform
PDF
100% (8)
Case Study: Using MongoDB For An E-Commerce Platform
32 pages
CSL 204 Operating Systems Lab
PDF
No ratings yet
CSL 204 Operating Systems Lab
81 pages
Assignment Solution of CS606
PDF
No ratings yet
Assignment Solution of CS606
3 pages
C Exercises
PDF
No ratings yet
C Exercises
9 pages
Typical Questions & Answers
PDF
No ratings yet
Typical Questions & Answers
179 pages
q2 Chap8 Robert Lafore C++
PDF
No ratings yet
q2 Chap8 Robert Lafore C++
2 pages
CS401 Computer Architecture and Assembly Language 18 Pages Solved
PDF
No ratings yet
CS401 Computer Architecture and Assembly Language 18 Pages Solved
18 pages
Cit314 Summary From Noungeeks
PDF
No ratings yet
Cit314 Summary From Noungeeks
42 pages
Cosc 202 P Q
PDF
No ratings yet
Cosc 202 P Q
9 pages
Computer Concepts C Programming June 2012
PDF
No ratings yet
Computer Concepts C Programming June 2012
3 pages
Fortran Past Questions and Answers
PDF
100% (1)
Fortran Past Questions and Answers
4 pages
This Test Consists of 50 Questions. The Set Code For This Paper Is D
PDF
No ratings yet
This Test Consists of 50 Questions. The Set Code For This Paper Is D
31 pages
HND CBT_FINAL PRESENT
PDF
No ratings yet
HND CBT_FINAL PRESENT
24 pages
STET - 2019: Important Question Based On Exam Pattern
PDF
No ratings yet
STET - 2019: Important Question Based On Exam Pattern
42 pages
Module1 CSP
PDF
No ratings yet
Module1 CSP
9 pages
Solved MCQs ch#6
PDF
No ratings yet
Solved MCQs ch#6
3 pages
Written Test
PDF
No ratings yet
Written Test
9 pages
HCL Sample Paper
PDF
No ratings yet
HCL Sample Paper
32 pages
FinalQ_MTH_105_2017
PDF
No ratings yet
FinalQ_MTH_105_2017
2 pages
CMPSC+200+Midterm+2+Fall+2015 240624 150210
PDF
No ratings yet
CMPSC+200+Midterm+2+Fall+2015 240624 150210
15 pages
Robert Bosch Placement Pattern 2 - Freshers Choice
PDF
No ratings yet
Robert Bosch Placement Pattern 2 - Freshers Choice
14 pages
Aces Review Center: Ree Online Review Refresher Esas 7B by Engr. Jimmy L. Ocampo 0920 - 644 - 6246
PDF
No ratings yet
Aces Review Center: Ree Online Review Refresher Esas 7B by Engr. Jimmy L. Ocampo 0920 - 644 - 6246
5 pages
Smart Test Solution - V10(4)
PDF
No ratings yet
Smart Test Solution - V10(4)
3 pages
MCQ
PDF
100% (1)
MCQ
80 pages
Fortran Mcq
PDF
No ratings yet
Fortran Mcq
6 pages
Ges 103 Nigerian People and Culture
PDF
No ratings yet
Ges 103 Nigerian People and Culture
57 pages
BCH214.1 Lecture Note From Prof Ikewuchi
PDF
No ratings yet
BCH214.1 Lecture Note From Prof Ikewuchi
23 pages
Mechanics and Properties of Matter1
PDF
No ratings yet
Mechanics and Properties of Matter1
70 pages
BCH 210 Carbohydrate
PDF
No ratings yet
BCH 210 Carbohydrate
28 pages