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)
120 views
4 pages
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
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)
120 views
4 pages
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
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% (4)
Kakeibo Guide Template 2
9 pages
Concentrix Placement Paper 1
PDF
No ratings yet
Concentrix Placement Paper 1
16 pages
Custom Format
PDF
No ratings yet
Custom Format
9 pages
CSC Past Questions 2
PDF
No ratings yet
CSC Past Questions 2
17 pages
Load Utility: by Swapan Banerjee: ... Courtesy IBM Utility Guide & Reference Manual
PDF
No ratings yet
Load Utility: by Swapan Banerjee: ... Courtesy IBM Utility Guide & Reference Manual
20 pages
BPC Sample Code - 2
PDF
100% (1)
BPC Sample Code - 2
8 pages
CSC 201 Past Questions
PDF
No ratings yet
CSC 201 Past Questions
13 pages
CIT 206 Test1 2020-2021
PDF
No ratings yet
CIT 206 Test1 2020-2021
2 pages
Com 225 Web Technology Theory
PDF
No ratings yet
Com 225 Web Technology Theory
209 pages
Com113 Exams Ques 2023
PDF
No ratings yet
Com113 Exams Ques 2023
4 pages
Search Sort MCQ Gate
PDF
No ratings yet
Search Sort MCQ Gate
12 pages
Mainframe FAQ
PDF
No ratings yet
Mainframe FAQ
117 pages
CPR C Programs - CH05 Pointers
PDF
100% (1)
CPR C Programs - CH05 Pointers
1 page
Cit314 Summary From Noungeeks
PDF
No ratings yet
Cit314 Summary From Noungeeks
42 pages
Key Values For Keyboard
PDF
100% (1)
Key Values For Keyboard
5 pages
Object Oriented Programming: File Handling in C++
PDF
No ratings yet
Object Oriented Programming: File Handling in C++
58 pages
Perl Programming
PDF
100% (4)
Perl Programming
277 pages
Cit308 Summary From Noungeeks
PDF
No ratings yet
Cit308 Summary From Noungeeks
87 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
CSC 232 Fortran Questions
PDF
No ratings yet
CSC 232 Fortran Questions
19 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
Adobe Scan 07 Jul 2024 1
PDF
No ratings yet
Adobe Scan 07 Jul 2024 1
13 pages
Smart Test Solution - V10
PDF
No ratings yet
Smart Test Solution - V10
3 pages
MCQ
PDF
100% (1)
MCQ
80 pages
Fortran MCQ
PDF
No ratings yet
Fortran MCQ
6 pages
MCQ
PDF
No ratings yet
MCQ
36 pages
2310 1069 Placement Paper of Ibm Sep 03
PDF
No ratings yet
2310 1069 Placement Paper of Ibm Sep 03
1 page
Ca Questions
PDF
No ratings yet
Ca Questions
4 pages
C MCQ's
PDF
No ratings yet
C MCQ's
6 pages
Binsys Technologies PVT - LTD
PDF
No ratings yet
Binsys Technologies PVT - LTD
18 pages
C Programming Questions
PDF
No ratings yet
C Programming Questions
8 pages
Sample Questions For General Aptitude
PDF
No ratings yet
Sample Questions For General Aptitude
4 pages
Fortran Note
PDF
No ratings yet
Fortran Note
20 pages
April, 2007 Fundamental IT Engineer Examination (Morning) : Questions Must Be Answered in Accordance With The Following
PDF
No ratings yet
April, 2007 Fundamental IT Engineer Examination (Morning) : Questions Must Be Answered in Accordance With The Following
32 pages
(WWW - Entrance-Exam - Net) - Sasken Communication Technologies Placement Sample Paper 3
PDF
No ratings yet
(WWW - Entrance-Exam - Net) - Sasken Communication Technologies Placement Sample Paper 3
5 pages
2022 MCA Question Paper LBS Kerala
PDF
No ratings yet
2022 MCA Question Paper LBS Kerala
10 pages
Adv C MCQ
PDF
No ratings yet
Adv C MCQ
6 pages
Suggestion
PDF
No ratings yet
Suggestion
7 pages
C Question PC Questionaper PDF
PDF
No ratings yet
C Question PC Questionaper PDF
4 pages
Computer Concept and Programming Questions
PDF
No ratings yet
Computer Concept and Programming Questions
15 pages
Computer Concepts C Programming Jan 2013 New
PDF
100% (1)
Computer Concepts C Programming Jan 2013 New
2 pages
Provisional Answer Key HSST Computer Science
PDF
No ratings yet
Provisional Answer Key HSST Computer Science
19 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
11 pages
Diwali H.W - Computer (Std-10)
PDF
No ratings yet
Diwali H.W - Computer (Std-10)
11 pages
Computer Application PP1 FA1 Grade 10 QP
PDF
No ratings yet
Computer Application PP1 FA1 Grade 10 QP
3 pages
CSC415
PDF
No ratings yet
CSC415
10 pages
SASken - Ques
PDF
No ratings yet
SASken - Ques
33 pages
Uva Province Grade 11 ICT 3rd Term Test Paper 2021 English Medium
PDF
No ratings yet
Uva Province Grade 11 ICT 3rd Term Test Paper 2021 English Medium
15 pages
(A) # Include "Test.h": Unsure Answers
PDF
No ratings yet
(A) # Include "Test.h": Unsure Answers
15 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