midtest - National University of Singapore SCHOOL OF...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
National University of Singapore SCHOOL OF COMPUTING MID SEMESTER TEST AY2010/2011 Semester 1 CS1010E – PROGRAMMING METHODOLOGY 2 October 2010 Time Allowed: 90 minutes INSTRUCTIONS TO CANDIDATES 1. This test paper consists of TWELVE (12) questions and comprises TEN (10) printed pages, including this page. 2. Answer ALL questions. 3. Answer Section A (Questions 1 to 10) by shading the letter corresponding to the most appropriate answer on the OCR form provided. 4. Answer Section B (Questions 11 to 12) within the space provided in this booklet. You may use pen or pencil to write your answers. 5. Do not detach any pages from this booklet. 6. This is an OPEN BOOK test. The maximum mark is 20 . 7. Calculators are allowed, but not electronic dictionaries, laptops, PDAs, or other computing devices. 8. Do not look at the questions until you are told to do so. 9. Please write your matriculation number below. MATRICULATION NUMBER: This portion is for examiner’s use only Section Marks Remarks Q11 Q12 Total 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SECTION A (10 Multiple Choice Questions : 10 Marks) Each question has one correct answer. Shade the letter corresponding to the correct answer on the OCR form provided. 1 mark for each correct answer and no penalty for wrong answer. 1. Given an amount of money in cents, we would like to exchange the amount for the least number of 50-cents and 20-cents coins. The skeleton program is given as follows. #include <stdio.h> int main(void) { int money, coin20=0, coin50=0; scanf("%d", &money); /****************************************** Code fragment to be inserted here ******************************************/ printf("Exchanged for: "); printf("%d 20-cents and %d 50-cents\n", coin20, coin50); printf("Left over amount: %d\n", money); return 0; } Which of the following code fragments work correctly? i.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/05/2012 for the course MATHEMATIC MA1505 taught by Professor Freudleong during the Spring '10 term at National University of Singapore.

Page1 / 10

midtest - National University of Singapore SCHOOL OF...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online