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)
56 views
CSC128 (Dec 2018) Question
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 now
Download
Save CSC128 (DEC 2018) QUESTION For Later
Download
Save
Save CSC128 (DEC 2018) QUESTION For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
56 views
CSC128 (Dec 2018) Question
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 now
Download
Save CSC128 (DEC 2018) QUESTION For Later
Carousel Previous
Carousel Next
Save
Save CSC128 (DEC 2018) QUESTION For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 11
Search
Fullscreen
CONFIDENTIAL, CSIDEC 2018/¢8C128 UNIVERSITI TEKNOLOGI MARA FINAL EXAMINATION COURSE : FUNDAMENTALS OF COMPUTER PROBLEM SOLVING COURSE CODE : CSC128 EXAMINATION : DECEMBER 2018 TIME : 3 HOURS 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 17 printed pages (© Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL, 2 CSIDEC 2018/¢SC128 PART A (20 MARKS) 1. The FIRST step in Program Development Life Cycle (PDLC) is to plan the algorithm analyze the problem desk check the algorithm code the algorithm pom> 2. Syntax errors in C++ ‘A. can cause subtle error when the application runs B. are ignored by the computer C. prevent the application from compiling correctly D. are detected after the application has been completed 3. Which of the following identifies the purpose of else ina if statement? ‘A. It identifies the value being compared. B. It terminates the i£ statement. C. It causes the compiler to skip the if statement. D. Itexecutes only if the test value does not equal any of the other cases in the if. 4. Which of the following is valid identifier in C++? A. bool B. HotelTransylvania3 C. Hour Work D. 2ndvalue 5. Whatis the result of the following expression if data type of y is int ? y=4+(3*(8+6)-3)/2 23 29 23.5 175 pop> 6. Which of the following statements is FALSE? A. A pre-test loop tests the condition prior to executing the loop body. B. Itis an error to use the for statement in awhile loop. C. Itis possible that the statements ina while loop are never executed, D. A loop that continues to execute endlessly is called an infinite loop. © Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL 3 CSIDEC 2018/¢SC128 7. How many times the loop will be executed? for (int y = 0; y < 8; y= y+ 3) cout << “Avengers: Infinity War” << endl; 8. What is the output of the following C++ program segment? int value = 0, total = 0; do { total = total + value; value = value + 2; } while (value < 5); cout << total; pom> 9. Which of the following function definition DOES NOT have any syntax error(s)? A. int CalSquare(int x) { int x; return (x * x); } B. double calcResult (float n) { return (2 * n); } C. void calcArea(int r) double answer; return answer = 3.142 * x * r; } D. int printvalue(int x) { } cout << x; © Hak Cipta Universiti Teknolog! MARA CONFIDENTIALCONFIDENTIAL 4 CSIDEC 2018/¢8C128 10. Which of the following statement is INCORRECT? A. Itis an error to use the return statement in the function with reference parameter. B. Only one value can be retumed to the calling function using the return statement. C. The type of the value returned by the function is a void when no value is returned, D. A function must be declared before it can be used. © Hak Cipta Universiti Teknologi MARA CONFIDENTIAL,CONFIDENTIAL, 5 CSIDEC 2018/¢8C128 PART B (50 MARKS) QUESTION 4 a) Evaluate the following logical expression: 13 13) && ((3 > 5) |] (13 < 10))) (2 marks) b) Identify input, process and output for a program to calculate and print the area of a square and the shaded region. (Hint: areaC = trr?, 1 = 3.142) side + side (4marks) c) Write a C++ program segment based on the following statements. Declare three variables called n1, n2, n3 as integer and one variable called average as double. Prompt the user to input 3 values and store them into n1, n2 and n3. Calculate the average of the 3 values entered. Then, print the input values obtained and the average. (4 marks) (© Hak Cipta Universiti Teknolog! MARA, CONFIDENTIALCONFIDENTIAL 6 CSIDEC 2018/C8C128 QUESTION 2 a) Determine the output for the following C++ expressions : i) cout << 55% 4+ 2-6/4 + pow (3, 2) << endl; (2marks) ii) cout << 2 ~ (5/7) +3 + (4% 5) + (1- (3 / 2) * 3)
>amount ; veturn amount; } float getDiscount (float amount) { float discount; discount = 0.25 * amount; return discount; Write a main () program that requires a user to input telephone bill amount using function getBillamount () and get the discount amount of the bill amount using function getDiscount (). Then calculate and display the bill amount after discount. (6 marks) (© Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL PART C (30 MARKS} QUESTION 1 ) 10 CSIDEC 2018/¢8C128 Kuching Digital Community Run is going to be held in the next coming holiday season. The following table shows the details: Category) [Citizen | Cost Distance! |) Time Limit |_Malaysian RM60_ Adults Ole TEDaD 5km 1 hour a Malaysian | __ RM20 3km 45 min _ Others USD15 In order to run the program smoothly, the organizer is hiring you as a programmer to develop ‘a computer program. In developing the program, you should consider each of the following: ‘+ The user's name, citizen, the number for each category, and distance should be entered following the respective INPUT statements. The program will repeat until the system administrator input is *N or n°. ‘* Calculate the total payment for each user and the grand total for all users. [Note: USD 1 = RM4] * Count the number of adults and kids involved in the whole program. * Write a complete C++ program and for each user generate a receipt using the format in the following exampl NAME CITIZEN NO. OF ADULT NO. OF KIDS PAYMENT ADULT KIDS TOTAL PAYMENT THANK YOU - Total number of kids (© Hak Cipta Universiti Teknologi MARA KUCHING DIGITAL COMMUNITY RUN 2078 AMIN BIN AMINUDDIN MALAYSIAN 2 2 RM120.00 RM80.00 RM200.00 RY MUCH Total number of adults : XX XX Grand Total = RM XXXX.XX (15 marks) CONFIDENTIAL,CONFIDENTIAL, " CSIDEC 2018/CSC128 QUESTION 2 Below is the car rental rates table of Kenyalang Car Rental Sdn. Bhd. Code Car Type Rental Rate per Day (RM) Viva 75.00 Tr Myvi 90.00 Proton 110.00 As a programmer, you are required to write a C+ program based on the following tasks ‘+ Write function carType () that receives car code and displays the car type. This function return car rental rate to the main program. © Adiscount of 10% will be given if a customer rents a car more than 3 days. Write function getDiscount () that receives number of days and car rental rate. The function will calculate and return the discount price. + Write a main) program and show how both functions are called in the main program. In the main program, customer needs to input name, address, telephone number, number of days and car code. The output of the program shown as below. KENYALANG CAR RENTAL Please enter customer name : Jelita Ali Please enter address : Kampung Setia Please enter telephone number : 0112345456 Please enter number of days Please enter car code (V - Viva, M-Myvi, P-Proton) : P Car Type: Proton PAYMENT INFO CAR RENTAL Customer namé : Jelita Ali Address : Kampung Setia Telephone number : 0112345456 Number of days : 3 Car code : P Rental Rate : RM 110 Rental after discount :RM 0 Price after discount : RM 330 (15 marks) END OF QUESTION PAPER (© Hak Cipta Universit Teknologi MARA CONFIDENTIAL
You might also like
Exercise Questions Finals-2
PDF
No ratings yet
Exercise Questions Finals-2
22 pages
Past Year Question
PDF
No ratings yet
Past Year Question
11 pages
CSC128-Question Final Exam Mac - Ogos 2022
PDF
No ratings yet
CSC128-Question Final Exam Mac - Ogos 2022
10 pages
2b Test Jan 2024
PDF
No ratings yet
2b Test Jan 2024
10 pages
Answer Sheet Csc128 Test 1 March2020
PDF
No ratings yet
Answer Sheet Csc128 Test 1 March2020
9 pages
CSC128 CSC415
PDF
No ratings yet
CSC128 CSC415
11 pages
CSC425
PDF
No ratings yet
CSC425
12 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
Test Februari 2022-1
PDF
No ratings yet
Test Februari 2022-1
11 pages
Csc126 Test May21
PDF
No ratings yet
Csc126 Test May21
8 pages
CSC425 - June 2014
PDF
No ratings yet
CSC425 - June 2014
13 pages
CSC126 Final Test July 2023
PDF
No ratings yet
CSC126 Final Test July 2023
11 pages
CSC126 Final Test Jan 2022
PDF
No ratings yet
CSC126 Final Test Jan 2022
9 pages
CSC125 128 ITC120 Mac2017
PDF
No ratings yet
CSC125 128 ITC120 Mac2017
12 pages
CSC128
PDF
No ratings yet
CSC128
11 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 1 Question (Dec 2016 - Apr 2017)
PDF
No ratings yet
Test 1 Question (Dec 2016 - Apr 2017)
16 pages
CSC425 - June 2013
PDF
No ratings yet
CSC425 - June 2013
13 pages
2022 Oct - CSC128 Quiz - Q
PDF
No ratings yet
2022 Oct - CSC128 Quiz - Q
4 pages
Test CSC415 - March-Aug 2023
PDF
No ratings yet
Test CSC415 - March-Aug 2023
10 pages
This Examination Paper Consists of 7 Printed Pages
PDF
No ratings yet
This Examination Paper Consists of 7 Printed Pages
7 pages
CSC125 ITC120 Apr2009
PDF
No ratings yet
CSC125 ITC120 Apr2009
9 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
C++ Lab Assignment
PDF
No ratings yet
C++ Lab Assignment
13 pages
Bitg 1113012004
PDF
No ratings yet
Bitg 1113012004
23 pages
MidtermPracticeProblems (1)
PDF
No ratings yet
MidtermPracticeProblems (1)
4 pages
Final Exam 2018
PDF
No ratings yet
Final Exam 2018
5 pages
CSC415
PDF
No ratings yet
CSC415
10 pages
Computer Programming Mid Exam 2011
PDF
No ratings yet
Computer Programming Mid Exam 2011
4 pages
Lab Sheet
PDF
No ratings yet
Lab Sheet
6 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
C++ Exam
PDF
No ratings yet
C++ Exam
5 pages
COMP108 - Review Questions With Answers 2
PDF
No ratings yet
COMP108 - Review Questions With Answers 2
11 pages
General Review Problems C++
PDF
0% (1)
General Review Problems C++
10 pages
Eeb315 Final Exam 2016 PDF
PDF
No ratings yet
Eeb315 Final Exam 2016 PDF
6 pages
Assignment 3(Due December 4)
PDF
No ratings yet
Assignment 3(Due December 4)
4 pages
Computer Science 15
PDF
No ratings yet
Computer Science 15
7 pages
HELLO
PDF
No ratings yet
HELLO
6 pages
C++ 07 Batch by 09CE37
PDF
No ratings yet
C++ 07 Batch by 09CE37
9 pages
CSC128 - Test - 8 July 2021 (Question) UiTM PENANG
PDF
No ratings yet
CSC128 - Test - 8 July 2021 (Question) UiTM PENANG
8 pages
5. Test 1 Csc415 Mac 2021 Skema
PDF
No ratings yet
5. Test 1 Csc415 Mac 2021 Skema
10 pages
202301211237141148136036
PDF
No ratings yet
202301211237141148136036
5 pages
Final Assignment
PDF
No ratings yet
Final Assignment
11 pages
Computer Science: 2024 III 09 0930 Seat No. Time: 3 Hours Subject Code H4 7 0 5
PDF
No ratings yet
Computer Science: 2024 III 09 0930 Seat No. Time: 3 Hours Subject Code H4 7 0 5
15 pages
Xi Cs First Setb1 Ques
PDF
No ratings yet
Xi Cs First Setb1 Ques
4 pages
GS200 Final Exam 2017
PDF
No ratings yet
GS200 Final Exam 2017
4 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
CP Btech 08 Mid Sem 19 09 08
PDF
No ratings yet
CP Btech 08 Mid Sem 19 09 08
2 pages
CS111 Exam
PDF
No ratings yet
CS111 Exam
19 pages
Midterm Examination Computer Programming 1 (IT 112/IT 31) : Seek GOD's Help and Guidance
PDF
No ratings yet
Midterm Examination Computer Programming 1 (IT 112/IT 31) : Seek GOD's Help and Guidance
4 pages
Jan 2010
PDF
No ratings yet
Jan 2010
8 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
Please Do Not Detached This Sheet
PDF
No ratings yet
Please Do Not Detached This Sheet
12 pages
CS101 Midterm Fall 2015 - Solution PDF
PDF
No ratings yet
CS101 Midterm Fall 2015 - Solution PDF
12 pages
CS -I
PDF
No ratings yet
CS -I
5 pages
1PExam - Prog1 Answer Key
PDF
No ratings yet
1PExam - Prog1 Answer Key
3 pages
c++ paper
PDF
No ratings yet
c++ paper
6 pages
Question_02
PDF
No ratings yet
Question_02
3 pages