Unit%Exam%#1% CSE115%Introduction%to%Computer%Science %I% Spring%2016%%1%%!EXAMINATION%INSTRUCTIONS%%NAME:%___________________________%%PERSON%NUMBER:%___________________________%%SIGNATURE:%___________________________%%This%examination%has%6%pages.%Check%that%you%have%a%complete%paper.%Each%candidate%should%be%prepared%to%produce,%upon%request,%his%or%her%SUNY/UB%card.%This%examination%has%5%questions.%Answer%all%questions.%You$have$60$minutes$to$complete$this$examination.$$Use$your$time$accordingly.$%READ%AND%OBSERVE%THE%FOLLOWING%RULES:%%► Names%are%pre-printed%on%the%exam%booklets.%%Ensure%that%you%have%YOUR%exam.%► Sign,%using%your%usual%signature,%in%the%space%provided%on%the%back%cover.%► All%of%your%writing%must%be%handed%in.%This%booklet%must%not%be%torn%or%mutilated%in%any%way,%and%must%not%be%taken%from%the%examination%room.%► Show% all%of% your%work% in%arriving%at% an%answer,% unless%instructed%otherwise.% Partial% credit%will%be%awarded%as%appropriate.%► Candidates%are%not%permitted%to%ask%questions%of%the%invigilators,% ex cep t% in% ca ses % of% su pp os ed %errors%or%ambiguities%in%examination%questions.%► CAUTION% –% Candidates% guilty% of% any% of% the% following,% or% similar,% dishonest% practices% shall% be%imme d iat ely %d ismissed%from %th e%e x amination%and %s h all%b e %lia ble%to%disciplinary%action.%♦ Making% use% of% any% books,% papers% or% memoranda,% calculators% or% computers,% audio% or%visual% cassette% players,% or% other% memo ry% aid% d evices,% other% than% those% explicitly%authorised%by%the%examiners.%♦ Speaking%or%communicating%with%other%candidates.%♦ Purposely%exposing% w ritten%p apers% to%the%view%of%other% ca ndidates.%The%p lea% of%accident%or%forgetfulness%shall%not%be%received.%%---------------------------%DO%NOT%WRITE%BELOW%THIS%LINE!%---------------------------%%Q1%Q2%Q3%Q4%Q5%TOTAL%%$/10%/10%/10%/10%/10%/50%/100$%! !Unit%Exam%#1% CSE115%Introduction%to%Computer%Science %I% Spring%2016%%2%%Question!1![10!points,!2!points!each] The code given below is correct: it compiles without errors. Circle, and identify by number, one and only one example of each of the following items in the code below. If you believe no example exists, write “no example” next to that item in the list. To show you how I want the question answered, the first one is done for you. 1. access control modifier 2. expression 3. class body 4. fully qualified name 5. argument 6. assignment statement package part1; public class Farm { private example1.BarnYard _yard; public Farm() { _yard = new example1.BarnYard(); } public void addOneMovingChicken() { example1.Chicken c = new example1.Chicken(); _yard.addChicken(c); c.start(); } public void addOneMovingPig() { example1.Pig p = new example1.Pig(); _yard.addPig(p); p.start(); } public void addOneMovingButterfly() { example1.Butterfly b = new example1.Butterfly(); _yard.addButterfly(b); b.start(); } }!!1$Unit%Exam%#1% CSE115%Introduction%to%Computer%Science%I% Spring%2016%%3%%Question!1![10!points,!2!points!each] The code given below is correct: it compiles without errors. Circle, and identify by number, one and only one example of each of the following items in the code below. If you believe no example exists, write “no example” next to that item in the list. To show you how I want the question answered, the first one is done for you. 1. access control modifier 2. expression 3. class body 4. fully qualified name 5. argument 6. assignment statement package part1; public class Farm { private example1.BarnYard _yard; public Farm() { _yard = new example1.BarnYard(); } public void addOneMovingChicken() { example1.Chicken c = new example1.Chicken(); _yard.addChicken(c); c.start(); } public void addOneMovingPig() { example1.Pig p = new example1.Pig(); _yard.addPig(p); p.start(); } public void addOneMovingButterfly() { example1.Butterfly b = new example1.Butterfly(); _yard.addButterfly(b); b.start(); } }!!1$Unit%Exam%#1% CSE115%Introduction%to%Computer%Science%I% Spring%2016%%4%%Question!1![10!points,!2!points!each] The code given below is correct: it compiles without errors. Circle, and identify by number, one and only one example of each of the following items in the code below. If you believe no example exists, write “no example” next to that item in the list. To show you how I want the question answered, the first one is done for you. 1. access control modifier 2. expression 3. class body 4. fully qualified name 5. argument 6. assignment statement package part1; public class Farm { private example1.BarnYard _yard; public Farm() { _yard = new example1.BarnYard(); } public void addOneMovingChicken() { example1.Chicken c = new example1.Chicken(); _yard.addChicken(c); c.start(); } public void addOneMovingPig() { example1.Pig p = new example1.Pig(); _yard.addPig(p); p.start(); } public void addOneMovingButterfly() { example1.Butterfly b = new example1.Butterfly(); _yard.addButterfly(b); b.start(); } }!!1$Unit%Exam%#1% CSE115%Introduction%to%Computer%Science %I% Spring%2016%%5%%Question!1![10!points,!2!points!each] The code given below is correct: it compiles without errors. Circle, and identify by number, one and only one example of each of the following items in the code below. If you believe no example exists, write “no example” next to that item in the list. To show you how I want the question answered, the first one is done for you. 1. access control modifier 2. expression 3. class body 4. fully qualified name 5. argument 6. assignment statement package part1; public class Farm { private example1.BarnYard _yard; public Farm() { _yard = new example1.BarnYard(); } public void addOneMovingChicken() { example1.Chicken c = new example1.Chicken(); _yard.addChicken(c); c.start(); } public void addOneMovingPig() { example1.Pig p = new example1.Pig(); _yard.addPig(p); p.start(); } public void addOneMovingButterfly() { example1.Butterfly b = new example1.Butterfly(); _yard.addButterfly(b); b.start(); } }!!1$Unit%Exam%#1% CSE115%Introduction%to%Computer%Science%I% Spring%2016%%6%%Question!1![10!points,!2!points!each] The code given below is correct: it compiles without
View Full Document