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)
44 views
12 pages
CSC125 128 ITC120 Mac2017
csc questions
Uploaded by
adam
AI-enhanced title
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 CSC125_128_ITC120_mac2017 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
44 views
12 pages
CSC125 128 ITC120 Mac2017
csc questions
Uploaded by
adam
AI-enhanced title
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 CSC125_128_ITC120_mac2017 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save CSC125_128_ITC120_mac2017 For Later
You are on page 1
/ 12
Search
Fullscreen
CONFIDENTIAL ss CSIMAR 2017/CSC125/128/ITC120 UNIVERSITI TEKNOLOGI MARA FINAL EXAMINATION COURSE : FUNDAMENTALS OF COMPUTER PROBLEM SOLVING COURSE CODE : CSC125/128/ITC120 EXAMINATION : MARCH 2017 TIME : 3HOURS INSTRUCTIONS TO CANDIDATES 1 This question paper consists of three (3) parts: PART A (10 Questions) PART B (5 Questions) PART C (2 Questions) 2. Answer ALL questions 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 invigitator. 4 Please check to make sure that this examination pack consists of : i) the Question Paper ii) an Answer Booklet ~ provided by the Faculty 5. ‘Answer ALL questions in English. DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO This examination paper consists of 12 printed pages (© Hak Cipta Universiti Teknolog! MARA CONFIDENTIALCONFIDENTIAL, 2 CSIMAR 2017/CSC125/128/TC120 PART A (20 MARKS) 1 is a program that translates source code of high-level language into machine language one instruction at a time. A. Compiler B. Interpreter C. Assembler D. Source code 2. Select the statement that describes the Maintenance Phase of the Program Development Life Cycle (PDLC). List down or draw the steps involved in sequence to solve the problem. Define the problem to be solved with clear specifications of the problem. Modify or upgrade the existing program or system. Find and eliminate errors by checking the program with all types of data and cases. pOm> 3. _Allof the following statements are valid declaration and initialization of PIE with 3.142 A. fdefine PIE = 3.142; B. #define PIE 3.142 C. const float PIE = 3.142; D. float PIE = 3.142; 4. Choose the CORRECT rules for naming identifiers in C++, i, Identifiers must begin with a letter or underscore. ii. Allletters and digits or underscore may follow the initial letter. iil. Identifiers cannot be reserved words. iv. No different between uppercase and lowercase letters A iii B. i, iii Cc tii D. i, i, ii, iii, iv {© Hak Cipta Universit Teknologi MARA CONFIDENTIALCONFIDENTIAL, 3 CS/MAR 2017/CSC125/128/TC120 5. Select the relational operator that is INVALID. A < Boos Co D. 6. Analyze the following program fragment and determine the result. int i= 4; if (i te 4 { if (i > 8) iei-4 else isis; } else { ican) ieiea; else iei-7; ub = Ao Bo -3 Cc o8 D8 7. Identify the looping process that checks the test condition at the end of the loop. A. for B. while C. do-while D. no looping process checks the test condition at the end, (© Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL, 4 CSIMAR 2017/CSC125/128/ITC120 Determine the output of the program below if the input is 6. int x,y, #1. cin >> y; for (int x { } cout << 2; x++) zt x; 72 720 7200 72000 pomp 9. All of the following functions are for manipulating string data EXCEPT: A. strepy() B. strcat () C. strlen() D. strempr() (© Hak Cipta Universiti Teknologi MARA, CONFIDENTIALCONFIDENTIAL 5 CSIMAR 2017/CSC125/1281TC120 10. Identify the output of the following program. Winclude
void first (int, inte); void second(ints, int); int main() { int q=1; int s = 2; first(q, s); cout << q << " " << 8 << endl; second(q, s); cout << q <<" " cc 8 << endl; } void first (int x, int& y) { int a; a=x x y } void second(inté s, int t) { int b; L 1 2 3 2 A 2 3 90 @ > WERE HHO (© Hak Cipta Universit Teknologi MARA, CONFIDENTIALCONFIDENTIAL, 6 CSIMAR 2017/CSC125/128/TC120 PART B (50 MARKS) QUESTION 1 a) List TWO (2) types of software and give ONE (1) example for each type. (2 marks) b) Differentiate between flowchart and pseudocode. (4 marks) c) Identify the input, process and output for calculating the surface area of a cyclinder. The formula is given below: surface area in a cylinder = 2nr? + 2nrh (4 marks) QUESTION 2 a) Write a C++ program segment for each of the following statement. i) Declare and initialize GST with 6% and product name with “wat ch’. ji) Prompt user to enter the length in inches and convert to the length in centimeter. (1 inch = 0.0254 meter) (4marks) b) Evaluate the following expressions (Show the steps of solution): i) Y=3*10%5+7/5 ii) Y=52%5*6+(15—5)%4 (4marks) (© Hak Cipta Universiti Teknologi MARA, CONFIDENTIAL,CONFIDENTIAL 7 CSIMAR 2017/CSC125/128/ITC120 QUESTION 3 a) — Given the following flowchart: result = frst number + second number — third number resul= frst number - second number / third number result = frst number * second number ~ (second number, + thie number) i) Write a pseudocode based on the above flowchart. (4marks) ii) Find the output if the inputs are 16, 15, 5, and 2 respectively. (2marks) (© Hak Cipta Universiti Teknologi MARA. CONFIDENTIALCONFIDENTIAL, 8 CSIMAR 2017/CSC125/128/TC120 b) Fix the errors in the following program fragments: i) The purpose of the program is display pass or fail based on the marks entered. cout << “Enter your marks:"; | if (50 <= marks <= 100) strepy (result, "PASSED") ; else if strepy (result, “FAILED") ; cout << "You result the test” << endl; (4 marks) ji) The normal salary rate is RM 45 per day if the total working days in a month are between 16 to 28 days (inclusive of 16 and 28). Otherwise if the total working days are less than 15 days in a month, the salary rate is half of the normal rate. float rate, salary; int totalWorkingDays; cout << “\n Enter number of working days: cin << totalWorkingDays; if (totalWorkingDays > 15 || totalWorkingDays <= 28) salary = totalWorkingDays * rate; else salary = totalWorkingDays + (rate/2); cout << “\n The salary is RM” << salary; (4 marks) © Hak Cipta Universit Teknologi MARA CONFIDENTIALCONFIDENTIAL, 9 CSIMAR 2017/CSC125/128/TC120 QUESTION 4 a) Determine the output of the following program segments: i) int a= 12, b= 18, x; cout << acc " "ce bcc" "; while (b != 0) { at by b; ber; } cout << aj (2 marks) ii) while (m != n) { if(m < n) m += Dj else a t= } cout << pce" "ce mcc "ce ny (2 marks) b) Write a C++ program segment based on the following problems: i) Display the highest number among ten positive integer numbers entered by user. Given is the sample output screen: Enter ten positive integer numbers: 34 76 98 564 65 79 2 45 76 54 The highest number is 564 li) Display the following output using a nested for loop. 22 z 3 2 3 (6 marks) @ Hak Cipta Universit Teknologi MARA CONFIDENTIALCONFIDENTIAL, 10 CSIMAR 2017/CSC125/128/TC120 QUESTION 5 a) Write the function headers for the following problems: i) Function calccomm() will return a sales commission, receive the sales amount and the commission rate. (1 mark) ii) Function displayMonth() will accept the month in number and year, and display the name of the month and the year. (1 mark) ili) Function convertLetter() will input a lowercase letter and return the corresponding uppercase letter through parameter. (1 mark) b) Function circlearea() below will calculate and return the area of a circle: float circleArea(float radius) { float area = 3.142 * radius * radius; return area; } i) Write a main program that reads the radius of two circles. By using the function circleArea () above, calculate the area of the shaded region as shown in the following figure. (5 marks) (© Hak Cipta Universiti Teknologl MARA, CONFIDENTIALCONFIDENTIAL " CSIMAR 2017/CSC125/128/ITC120 PART C (30 MARKS) QUESTION 1 Cats@Home is a grooming centre for cats that provide a wide range of grooming of shown below: [__AGE (MONTHS) CODE-TYPE OF SERVICES PRICE (RM) | 1- Nail Trimming 15.00 |_Smonths and below | | —>— kitten Bath And Brush 50.00 7 - Nail Trimming 20.00 Above S months 2- Kitten Bath And Brush 60.00 Write a complete C++ program that will be repeated until the user enter ‘N’ to stop. The program will perfom the following tasks: * Get input from user for the following information. > Name of the owner and catikitten. > Age of the catkitten in months > Code of the service type (1 - Nail Trimming, 2 - Cat/Kitten Bath and Brush) © Customers who choose code 2 are given the option to add a medicated shampoo with an additional price of RM 5.00 * Calculate the total fee. The total fee charged is subjected to 6% Government Service Tax. * Display the receipt as shown in the following example: Owner's name cat's name Lola Age (in months): 5 Service Type: Kitten Bath and Brush Fee : RM 55.00 Tax : RM 3.30 Total Fee : RM 58.30 ~Cat@lome-- Khalil aAwang (15 marks) (© Hak Cipta Universit Teknologi MARA CONFIDENTIAL,CONFIDENTIAL QUESTION 2 Below is the conversion table of Malaysian Ringgit to various currer 12 CSIMAR 2017/CSC125/128/ITC120 S. Foreign Currency Units | Country Code_| Malaysian Ringgit | 1.UK Pound A 5.70 | 1 EURO B 4.42 | 11US Dollar Cc 3.94 J ‘Your tasks are to: * Write function calcCurrency () that receives Malaysian Ringgit and will calculate the equivalent amount to all the currencies in the table above. Display the Malaysian Ringgit and all the converted values. The function will return only the US Dollar to the main Program. * Aprofit of 10% will be given if the US Dollar converted is greater than US Dollar 1000.00. Write a function calcProfit () that receives the amount converted in US Dollar in (a) and return the total amount. * Write the main program and show how both functions are called in the main program. The function will be called repeatedly until the user wishes to stop. At the end of the process, display the total amount of Malaysian Ringgit that has been processed. The followi is a sample output screen: Please enter the amount of money? RN 340 RM 340.00 is equivalent to 59.65 Pound 76.92 EURO 86.96 US Dollar Do you wish to continue (¥/N)? y Please enter the amount of money: RM 6500 RM 6500.00 is equivalent to 1140.35 Pound 2470159 EURO 1662.40 US Dollar Us dollar after profit is: 1828.64 US Dollar Do you wish to continue (¥/N)? ‘The total amount of RM that has been processed is: RM 6840.00 (15 marks) END OF QUESTION PAPER (© Hak Cipta Universiti Teknologi MARA, CONFIDENTIAL,
You might also like
CSC128-Question Final Exam Mac - Ogos 2022
PDF
No ratings yet
CSC128-Question Final Exam Mac - Ogos 2022
10 pages
(Final Question) Csc425 Final Test Jul 2023
PDF
No ratings yet
(Final Question) Csc425 Final Test Jul 2023
11 pages
1st Puc Lab Manual Dudda PDF
PDF
100% (3)
1st Puc Lab Manual Dudda PDF
55 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
Class Xi Computer Science Paper For Half Yearly Exam 2010
PDF
60% (5)
Class Xi Computer Science Paper For Half Yearly Exam 2010
8 pages
TEST
PDF
No ratings yet
TEST
8 pages
CC103
PDF
100% (1)
CC103
12 pages
Test CSC415 - March-Aug 2023
PDF
No ratings yet
Test CSC415 - March-Aug 2023
10 pages
C Greenbook
PDF
No ratings yet
C Greenbook
78 pages
1st Puc Lab Manual
PDF
No ratings yet
1st Puc Lab Manual
54 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
Muhammad Bilal
PDF
No ratings yet
Muhammad Bilal
37 pages
PRACTICALS Hemo Roll No 21 EDIT
PDF
No ratings yet
PRACTICALS Hemo Roll No 21 EDIT
330 pages
Edited Merged
PDF
No ratings yet
Edited Merged
38 pages
This Examination Paper Consists of 7 Printed Pages
PDF
No ratings yet
This Examination Paper Consists of 7 Printed Pages
7 pages
24EEB0B59 Ass 2
PDF
No ratings yet
24EEB0B59 Ass 2
28 pages
Programming Mini ProjectCSC430
PDF
No ratings yet
Programming Mini ProjectCSC430
7 pages
General Review Problems C++
PDF
0% (1)
General Review Problems C++
10 pages
Mcoa011 Main Exam Paper 2017
PDF
No ratings yet
Mcoa011 Main Exam Paper 2017
10 pages
Past Year Question
PDF
No ratings yet
Past Year Question
11 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
Mid+ CS100F17V1
PDF
No ratings yet
Mid+ CS100F17V1
13 pages
Mid+ CS100F17V1
PDF
No ratings yet
Mid+ CS100F17V1
13 pages
C++ Lab Assignment
PDF
No ratings yet
C++ Lab Assignment
13 pages
Bitg 1113012004
PDF
No ratings yet
Bitg 1113012004
23 pages
Eeb315 Final Exam 2016 PDF
PDF
No ratings yet
Eeb315 Final Exam 2016 PDF
6 pages
Test Februari 2022-1
PDF
No ratings yet
Test Februari 2022-1
11 pages
CSC126 Final Test Jan 2022
PDF
No ratings yet
CSC126 Final Test Jan 2022
9 pages
Test 1 Csc415 Mac 2021 Skema
PDF
No ratings yet
Test 1 Csc415 Mac 2021 Skema
10 pages
Contoh2 Soalan Chapter1 and 2 - 1
PDF
No ratings yet
Contoh2 Soalan Chapter1 and 2 - 1
10 pages
CSC128 (Dec 2018) Question
PDF
No ratings yet
CSC128 (Dec 2018) Question
11 pages
(CSC415) Final Assessment July 2022
PDF
No ratings yet
(CSC415) Final Assessment July 2022
9 pages
Mid+ CS100F17V1 +solution
PDF
No ratings yet
Mid+ CS100F17V1 +solution
12 pages
Worksheet One
PDF
No ratings yet
Worksheet One
5 pages
2022 Oct - CSC128 Quiz - Q
PDF
No ratings yet
2022 Oct - CSC128 Quiz - Q
4 pages
CSC126 Final Test July 2023
PDF
No ratings yet
CSC126 Final Test July 2023
11 pages
Csc126 Test May21
PDF
No ratings yet
Csc126 Test May21
8 pages
CBSE Sample Question Papers For Class 12 Computer Science Old 2020
PDF
No ratings yet
CBSE Sample Question Papers For Class 12 Computer Science Old 2020
16 pages
Answer Sheet Csc128 Test 1 March2020
PDF
No ratings yet
Answer Sheet Csc128 Test 1 March2020
9 pages
CSC425 - June 2014
PDF
No ratings yet
CSC425 - June 2014
13 pages
2b Test Jan 2024
PDF
No ratings yet
2b Test Jan 2024
10 pages
CSC128 CSC415
PDF
No ratings yet
CSC128 CSC415
11 pages
PF LAB 03 (Conditional Statements)
PDF
No ratings yet
PF LAB 03 (Conditional Statements)
4 pages
CSC128
PDF
No ratings yet
CSC128
11 pages
Pba Hssc-II by Iram Zahoor
PDF
No ratings yet
Pba Hssc-II by Iram Zahoor
3 pages
CSC128 - Test - 8 July 2021 (Question) UiTM PENANG
PDF
No ratings yet
CSC128 - Test - 8 July 2021 (Question) UiTM PENANG
8 pages
Tutorial Letter 104/1/2014: Assignment 1
PDF
No ratings yet
Tutorial Letter 104/1/2014: Assignment 1
8 pages
CSC415 Dec 2016 Final
PDF
No ratings yet
CSC415 Dec 2016 Final
10 pages
Cca 3112 Cia 3112 Introduction To Computer Programming
PDF
No ratings yet
Cca 3112 Cia 3112 Introduction To Computer Programming
3 pages
Assignment 4
PDF
No ratings yet
Assignment 4
10 pages
CSC126 Fundamentals of Algorithms & Computer Problem Solving Quiz 1
PDF
No ratings yet
CSC126 Fundamentals of Algorithms & Computer Problem Solving Quiz 1
5 pages
Assignment 02
PDF
No ratings yet
Assignment 02
6 pages
CSC425 - June 2013
PDF
No ratings yet
CSC425 - June 2013
13 pages
Past Paper-1
PDF
No ratings yet
Past Paper-1
2 pages
CSC425
PDF
No ratings yet
CSC425
12 pages
General Instructions: 1. All Questions Are Compulsory. 2. Programming Language Is C++
PDF
No ratings yet
General Instructions: 1. All Questions Are Compulsory. 2. Programming Language Is C++
4 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