9
Sample Mid-Term Test ITECH1400 Foundations of Programming School of Science, Information Technology and Engineering SAMPLE MID-TERM TEST ITECH1400 Foundations of Programming Mid-Term Test Duration: 50 minutes Total Marks: 10 (10%) Reading Time: 10 minutes Test Conditions: This is a THEORY test. This is a CLOSED BOOK test. Materials Permitted In The Test Venue: Normal writing materials Materials To Be Supplied To Students: Nil. Instructions To Students: Attempt ALL questions. Page 1 of 9 Student Number __ __ __ __ __ __ __ __ Family Name _______________________ DO NOT REMOVE ANY PART OF THIS PAPER FROM THE MID-TERM TEST RULES 1. Do not detach any portion of the mid-term test paper. 2. Listen for all instructions from venue supervisors. 3. Do not begin writing until reading time has ended. 4. Ensure that you print your name

Itech1400 Sample Mid-term Test

Embed Size (px)

DESCRIPTION

ididididi

Citation preview

Sample Mid-Term Test ITECH1400 Foundations of ProgrammingStudent Number__ __ __ __ __ __ __ __Family Name_______________________First Name_______________________

School of Science, Information Technology and EngineeringSAMPLE MID-TERM TESTITECH1400 Foundations of Programming

Mid-Term Test Duration:50 minutesTotal Marks: 10 (10%)Reading Time:10 minutesTEST RULES1. Do not detach any portion of the mid-term test paper.2. Listen for all instructions from venue supervisors.3. Do not begin writing until reading time has ended.4. Ensure that you print your name and student number on all exam papers.

Test Conditions:This is a THEORY test.This is a CLOSED BOOK test.Materials Permitted In The Test Venue:Normal writing materialsMaterials To Be Supplied To Students:Nil.Instructions To Students:Attempt ALL questions.

DO NOT REMOVE ANY PART OF THIS PAPER FROM THE MID-TERM TEST VENUE.

Question 1.Review the snippet of code below.a) Describe what happens when this code runs.[ 1 mark ]public static void main(String[] args) {Scanner in = new Scanner(System.in);int age;System.out.println("Enter an integer between 10 and 20:");age=in.nextInt();if (age == 10 || age== 11 || age == 12) System.out.println(This person is a pre-teen);else if (13