midterm12 - Comp Sci 1MD3 Mid-Term I 2005 Dr. Jacques...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Comp Sci 1MD3 Mid-Term I 2005 Dr. Jacques Carette Name: Student No.: Duration : 50 minutes • This midterm contains 17 questions on 7 pages. • This midterm will be marked out of 50. There are 54 total marks available. • Answer the questions in the space provided. • Do not separate the pages. • Make sure that you do not get stuck on one question; use your time wisely. • You should spend roughly 1 minute per mark for each question. 1. First, translate the following Pascal code fragment to C, keeping the structure as similar as possible. Then write the smallest C program you can which does the same thing. [6] program funny; const len = 10; var i,j: Integer; L: Array[1..len] of Integer; begin for i := 1 to len do begin L[i] := len-i; end; j := len; repeat begin writeln(L[j]); j := j - 1; end; until j = 0; end. 2 2. What is the difference between a declaration and an imperative statement (in languages like C and Pascal)? [2] 3. What is the difference between machine language and assembly language? Illustrate your3....
View Full Document

This note was uploaded on 10/27/2009 for the course COMP SCI 1MD3 taught by Professor Various during the Winter '07 term at McMaster University.

Page1 / 7

midterm12 - Comp Sci 1MD3 Mid-Term I 2005 Dr. Jacques...

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

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