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)
69 views
CSC425 - June 2014
fgf
Uploaded by
nurulselangor
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save CSC425_june 2014 For Later
Download
Save
Save CSC425_june 2014 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
69 views
CSC425 - June 2014
fgf
Uploaded by
nurulselangor
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save CSC425_june 2014 For Later
Carousel Previous
Carousel Next
Save
Save CSC425_june 2014 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 13
Search
Fullscreen
CONFIDENTIAL, CSIJUN 2014/68C425 UNIVERSITI TEKNOLOGI MARA FINAL EXAMINATION COURSE : INTRODUCTION TO COMPUTER PROGRAMMING COURSE CODE : CSC425 EXAMINATION : JUNE 2014 TIME : 3HOURS INSTRUCTIONS TO CANDIDATES 1 This question paper consists of three (3) parts: PART A (15 Questions) PART B (5 Questions) PART C (2 Questions) 2. Answer ALL questions from all three (3) parts i) Answer PART A in the Objective Answer Sheet. ii) Answer PART B and PART C in the Answer Booklet. Start each answer on a new page. 3, Do not bring any material into the examination room unless permission is given by the invigilator, 4, Please check to make sure that this examination pack consists of : i) the Question Paper an Answer Booklet — provided by the Faculty ii) an Objective Answer Sheet — provided by the Faculty DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO This examination paper consists of 73 printed pages © Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL 2 CSIJUN 2014/C8C425 PART A (30 MARKS) a Aset of value and a set of operation can be applied to specific type is called a_. ‘A) reserve words B) keywords C) syntax D) data type Which of the following is classified as high level programming language? A) Assembly language 8) Machine Language C) Ce D) Flowchart A process of identifying and fixing the error(s) in a source code is called _. A) compiling 8) coding C) debugging D) designing In the counter-controlled loop, the counter variable must be declare and initialize a variable named population to 0. A) double population; B) double population = 0; C) long population; D) long population = 0; (© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL,CONFIDENTIAL 3 CSIJUN 2014/68C425 6. Which of the following statements declares a constant called vot ingage which value is 21? A) const votingAge = 21; B) const int votingage; C) const int votingAge = 21; D) int votingage = 21; 7. Given the following code fragment: int i= 2; while (i { -1) cout << “Hello\n”; atest) How many times the output statement will be executed? ‘A) Infinite loop B) 0 c) 4 D) 3 8. Given the following code fragment: while(inValue != 999) ( statement (s); ) bo The role of “999" is known as __. A) sentinel Value B) input value C) counter variable value D) limit variable (© Hak Cipta Universiti Teknolog! MARA, CONFIDENTIALCONFIDENTIAL, 4 CSIJUN 2014/¢8C425 9, Whats the output of the following code segment if the input values are 4,6,77 int num; cin >> num; while(num % 2 == 0) ( cout << num +1 <> num; ) | A) 8) 6 7 56 7] c) 45677 D) 45677 10. Which of the following statements declares a string called name that is able to hold up to 19 characters? A) char name; B) char name = 20; C) char name [20]; D) char(20] name; 11. Given the following array declaration: double moistLevel [8]; Which of the following statements is TRUE pertaining to the array? A) The array can holds 8 floating-point values. B) The first element of the array is refered to as moistLevel [1] C) The last element of the array is refered to as moistLevel (8) D) The array was initializaed with 0 .0 ‘© Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL, 5 CSIJUN 2014/¢8C425 12. What is the output of the following code fragment if user enters 99? cin >> num; if(num < 0) cout << "TRUE\n"; else if(num > 0) cout << "FALSE\n"; else cout << " ULL\n" )while(num != 99); A) TRUE B) FALSE ©) nuLL D) No output 13. Given the following array declaration: float fscore(SIZE] = (45.8, 68.3, 75.4, 88.0, 23.5, 100.0, 39.5, 50.5, 75.0,88.3}; Which of the following statements is TRUE to describe about an array? i. The size of the array is 10. ii. The identifier called st2B must be declared as constant ii, The array is named as fscore iv. The index of the last element is 10 A) iandiv B) iiand ii C) ii, itand ii D) ii, iii and iv © Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL, 6 CSIJUN 20141080425 14. 15. Given the following code fragment: int number; cin >> number; if (functionX (number) == 1) cout << “This is an odd number\n"; else cout << “This is an even number\n”; Which of the following the most suitable function prototype for the functionx()? A) int functionx (); B) void functionx (float); C) void functionx (int); D) int functionx (int); Given the following function definition: float avgvalue(float vil, float v2, float v2) { return ((vl + v2 + v3) / 3); ) Which of the following function call can be used to calculate the average of three numbers and assign it the variable avg? A) float avgvalue(45.0, 67.0, 89.0); B) avg = avgValue (45.0, 67.0, 89.0); C) avgvalue(45.0, 67.0, 89.0); D) avg = float avgValue (45, 67.0, 89.0); (© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL,CONFIDENTIAL 7 CSIJUN 2014/¢8C425 PART B (50 MARKS) QUESTION 1 a) Briefly explain the problem-solving process. (2 marks) b) Explain the use of an assembler and a compiler. (2 marks) c) _Indicate whether the following statements are TRUE or FALSE. i) Machine language is a language made up of binary-coded instructions that use directly by the computer. ii) Source code is a program written in a language. level programming il) Java and C are the examples of the low-level programming language. iv) During execution phase, the computer runs the compiler program and produces the object program. v) Flowchart is a fictional representation of an orderly step by step solution to a problem. vi) Run-time logic error occurs during the execution of the program. (6 marks) (© Hak Cipta Universiti Toknolog! MARA, CONFIDENTIALCONFIDENTIAL, 8 CSIJUN 2014/08C425 QUESTION 2 Draw a flowchart OR outline a pseudocode to solve the following problem. Traders Hotel is intoducing the new room rate for the year 2014: Types of Room Room Rate (RMinight) Super Luxury (S) 2500 Luxury (U) 1500 [Deluxe (D) 750 In order to calculate the charges, user is req ¢d to input: © Types of room * The number of days customer stay in the hotel 6% government tax will be added to the charges. Once the total charges (Inclusive of government tax) are calculated, display the total charges to the user. Your program should repeat the process for a few number of times until user enters 'N’ to terminate the program. (10 marks) (© Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL, 9 CSIJUN 2014/C8C425 QUESTION 3 a) Write a C++ statement for each of the following arithmetic expression. dy i) y= +a) (2 marks) b) Evaluate each of the following expressions. i) 5047/24 (5 +3) j)4+3>7668+1<10 == (2 marks) ©) Rewrite the main function to conform to good programming practice. int main ( Mu cout << "Reading source code is much easier \n"; cout << "if it is indented properly\n"; return 0;} (2 marks) 4) Declare the following variables with suitable data tyoe for each of the following items. i) An average score ii) Types of gender (2 marks) (© Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL 10 QUESTION 4 a) Identity the output for each of the following code fragments. i) char testVar = 'R'? switch (testVar) { case 'G': cout << "Brommm\n"; break; case 'R': cout << "Opsss\n"; case 'Y': cout << "Kabommm\n"; break; default : cout << "Safe\n"; }//end switch float num = 0.5; int i = 6; while (i > 0) ( if(i % 3 != 0) cout << num << ' 1; else cout << num << endl; int arr[4] = (1,0,1,1)7 int i = 0, temp; temp = arr(0]; while (i < 3) © geet) = aretieni: atts }//end while arr(i] = temp; cout << arr(0) << ' ' << arr[1] <
You might also like
Unit Load Method - Done
PDF
100% (6)
Unit Load Method - Done
35 pages
Timber Beam Design PDF
PDF
50% (2)
Timber Beam Design PDF
5 pages
Timber Beam Design
PDF
No ratings yet
Timber Beam Design
5 pages
CSC425
PDF
No ratings yet
CSC425
12 pages
CSC128 CSC415
PDF
No ratings yet
CSC128 CSC415
11 pages
Past Year Question
PDF
No ratings yet
Past Year Question
11 pages
CSC415 Dec 2016 Final
PDF
No ratings yet
CSC415 Dec 2016 Final
10 pages
CSC125 ITC120 Apr2009
PDF
No ratings yet
CSC125 ITC120 Apr2009
9 pages
CSC128-Question Final Exam Mac - Ogos 2022
PDF
No ratings yet
CSC128-Question Final Exam Mac - Ogos 2022
10 pages
CSC128
PDF
No ratings yet
CSC128
11 pages
CSC425 - June 2013
PDF
No ratings yet
CSC425 - June 2013
13 pages
CSC126 Final Test July 2023
PDF
No ratings yet
CSC126 Final Test July 2023
11 pages
Universiti Teknologi Mara Final Examination: Confidential CS/APR 2010/CSC128/415
PDF
No ratings yet
Universiti Teknologi Mara Final Examination: Confidential CS/APR 2010/CSC128/415
9 pages
CSC128 (Dec 2018) Question
PDF
No ratings yet
CSC128 (Dec 2018) Question
11 pages
CSC415
PDF
No ratings yet
CSC415
10 pages
Csc126 Test May21
PDF
No ratings yet
Csc126 Test May21
8 pages
Bitg 1113012004
PDF
No ratings yet
Bitg 1113012004
23 pages
2b Test Jan 2024
PDF
No ratings yet
2b Test Jan 2024
10 pages
TEST
PDF
No ratings yet
TEST
8 pages
CSC425 Final Test Jul 2023 (QUESTION) MUHAMMAD AIZUDDIN BIN ABD AZIZ 2023770767
PDF
No ratings yet
CSC425 Final Test Jul 2023 (QUESTION) MUHAMMAD AIZUDDIN BIN ABD AZIZ 2023770767
27 pages
Test Dec 2020 Feb 2021 Answer Scheme Students PDF
PDF
No ratings yet
Test Dec 2020 Feb 2021 Answer Scheme Students PDF
14 pages
This Examination Paper Consists of 7 Printed Pages
PDF
No ratings yet
This Examination Paper Consists of 7 Printed Pages
7 pages
cpp code 1 2024 (2)
PDF
No ratings yet
cpp code 1 2024 (2)
7 pages
2022 Oct - CSC128 Quiz - Q
PDF
No ratings yet
2022 Oct - CSC128 Quiz - Q
4 pages
CSC126 Final Test Jan 2022
PDF
No ratings yet
CSC126 Final Test Jan 2022
9 pages
GS200 Final Exam 2017
PDF
No ratings yet
GS200 Final Exam 2017
4 pages
Test Februari 2022-1
PDF
No ratings yet
Test Februari 2022-1
11 pages
(CSC415) Final Assessment July 2022
PDF
No ratings yet
(CSC415) Final Assessment July 2022
9 pages
Answer Sheet Csc128 Test 1 March2020
PDF
No ratings yet
Answer Sheet Csc128 Test 1 March2020
9 pages
3.0 March 2023
PDF
No ratings yet
3.0 March 2023
5 pages
Eeb315 Final Exam 2016 PDF
PDF
No ratings yet
Eeb315 Final Exam 2016 PDF
6 pages
C++ Lab Assignment
PDF
No ratings yet
C++ Lab Assignment
13 pages
Identification
PDF
No ratings yet
Identification
3 pages
FINAL EXAM QUESTION PAPER FSPK0022 FOC JULY 2023-2024
PDF
No ratings yet
FINAL EXAM QUESTION PAPER FSPK0022 FOC JULY 2023-2024
14 pages
CSC 1501 D Fundamental of Programming 201909
PDF
No ratings yet
CSC 1501 D Fundamental of Programming 201909
12 pages
Test CSC415 - March-Aug 2023
PDF
No ratings yet
Test CSC415 - March-Aug 2023
10 pages
Module1 CSP
PDF
No ratings yet
Module1 CSP
9 pages
202301211237141148136036
PDF
No ratings yet
202301211237141148136036
5 pages
CSC125 128 ITC120 Mac2017
PDF
No ratings yet
CSC125 128 ITC120 Mac2017
12 pages
Jan 2010
PDF
No ratings yet
Jan 2010
8 pages
CP Btech 08 Mid Sem 19 09 08
PDF
No ratings yet
CP Btech 08 Mid Sem 19 09 08
2 pages
PDF 3
PDF
No ratings yet
PDF 3
4 pages
North South University: Department of Computer Science and Engineering
PDF
No ratings yet
North South University: Department of Computer Science and Engineering
6 pages
CS111 Exam
PDF
No ratings yet
CS111 Exam
19 pages
Final Exam 2018
PDF
No ratings yet
Final Exam 2018
5 pages
MCOA011 MAIN EXAM PAPER 2017
PDF
No ratings yet
MCOA011 MAIN EXAM PAPER 2017
10 pages
XC350 Final Exam Abdullah Khalid
PDF
No ratings yet
XC350 Final Exam Abdullah Khalid
5 pages
Ict Nuces Papper
PDF
No ratings yet
Ict Nuces Papper
20 pages
CSC404 Feb 2023
PDF
No ratings yet
CSC404 Feb 2023
7 pages
Computer Concept and Programming Questions
PDF
No ratings yet
Computer Concept and Programming Questions
15 pages
Cs201 Mid Spring2007 s1
PDF
No ratings yet
Cs201 Mid Spring2007 s1
6 pages
Mid+ CS100F17V1
PDF
No ratings yet
Mid+ CS100F17V1
13 pages
Second Semester 2014 - 2015 Midterm Exam, Thursday April 2, 2015 Time: 120 Minutes
PDF
No ratings yet
Second Semester 2014 - 2015 Midterm Exam, Thursday April 2, 2015 Time: 120 Minutes
9 pages
CAPE Computer Science 2015 U1 P1 PDF
PDF
No ratings yet
CAPE Computer Science 2015 U1 P1 PDF
8 pages
Sample Paper - 2013 Class - X Subject - : Computer Applications (Two Hours)
PDF
No ratings yet
Sample Paper - 2013 Class - X Subject - : Computer Applications (Two Hours)
5 pages
MidtermExam F15
PDF
No ratings yet
MidtermExam F15
14 pages
Final Assignment
PDF
No ratings yet
Final Assignment
11 pages
5. Test 1 Csc415 Mac 2021 Skema
PDF
No ratings yet
5. Test 1 Csc415 Mac 2021 Skema
10 pages
CSC425 7
PDF
100% (1)
CSC425 7
7 pages
Lecture 1.95
PDF
No ratings yet
Lecture 1.95
16 pages
Introduction To Timber Designn
PDF
No ratings yet
Introduction To Timber Designn
32 pages
Chapter 4 (Concrete Work)
PDF
No ratings yet
Chapter 4 (Concrete Work)
25 pages
Tutorial 1 Ecs208 - Basic Solid Mechanics Learning Outcome: Thickness 30mm
PDF
No ratings yet
Tutorial 1 Ecs208 - Basic Solid Mechanics Learning Outcome: Thickness 30mm
3 pages
Introduction To Timber Designn
PDF
No ratings yet
Introduction To Timber Designn
32 pages
Chapter 2
PDF
No ratings yet
Chapter 2
28 pages
Introduction To The Construction Industry
PDF
No ratings yet
Introduction To The Construction Industry
29 pages
Tutorial 3 PDF
PDF
No ratings yet
Tutorial 3 PDF
1 page
Ecs 208 Topic
PDF
No ratings yet
Ecs 208 Topic
32 pages
Topic 1 - Examples
PDF
No ratings yet
Topic 1 - Examples
15 pages
Piles
PDF
100% (1)
Piles
47 pages
Tutorial 2 Ecs208 - Basic Solid Mechanics
PDF
No ratings yet
Tutorial 2 Ecs208 - Basic Solid Mechanics
2 pages
Topic 1: Real Fluid Flow: Learning Outcomes
PDF
No ratings yet
Topic 1: Real Fluid Flow: Learning Outcomes
24 pages
Control Structures (Repetition)
PDF
No ratings yet
Control Structures (Repetition)
16 pages
Topic 2: Steady Incompressible Flow in Pipelines: Learning Outcomes
PDF
No ratings yet
Topic 2: Steady Incompressible Flow in Pipelines: Learning Outcomes
21 pages
Topic 2: Analysis of Steady Flow in Pipeline
PDF
No ratings yet
Topic 2: Analysis of Steady Flow in Pipeline
22 pages
Flow in Open Channel: Prepared By: Amalina Amirah Abu Bakar
PDF
No ratings yet
Flow in Open Channel: Prepared By: Amalina Amirah Abu Bakar
121 pages
SOW Syll CSC425 04092014
PDF
No ratings yet
SOW Syll CSC425 04092014
4 pages
Ordinary Differential Equation: Euler Method: CES 512 Syahrul Fithry Senin
PDF
No ratings yet
Ordinary Differential Equation: Euler Method: CES 512 Syahrul Fithry Senin
18 pages
Lab Plastic Limit
PDF
No ratings yet
Lab Plastic Limit
17 pages