Sample exam FACULTY OF BUSINESS SAMPLE EXAMINATION ITC206 PROGRAMMING IN JAVA 1 DAY & DATE: XXXXXXXXXXTIME: WRITING TIME: Two (2) hours XXXXXXXXXXREADING TIME: Ten (10) minutes MATERIALS SUPPLIED BY...

i would like to get answers for this sample test.


Sample exam FACULTY OF BUSINESS SAMPLE EXAMINATION ITC206 PROGRAMMING IN JAVA 1 DAY & DATE: TIME: WRITING TIME: Two (2) hours READING TIME: Ten (10) minutes MATERIALS SUPPLIED BY UNIVERSITY: 1 x 12pp Answer Booklet General Purpose Answer Sheet MATERIALS PERMITTED IN EXAMINATION: Writing implements 2B Pencil/Eraser NUMBER OF QUESTIONS: Part A: 30 multiple-choice questions worth 45 marks Part B: 3 short-answer questions worth 25 marks each NUMBER OF MARKS: 120 marks INSTRUCTIONS TO CANDIDATES: 1. Enter your name, student number and signature into the box below. 2. Attempt ALL questions. 3. Start a new page for each new question, but NOT for each part of a question. 4. Read each question carefully to ensure that you have answered everything that is required in the question. Most questions have multiple parts. 5. There are 120 possible marks for this examination. 6. This examination is worth 50% of the final assessment for this subject. INSTRUCTIONS TO INVIGILATORS: Question paper May not be retained by the candidate STUDENT NAME: STUDENT NO: STUDENT SIGNATURE: PART A – Multiple-choice Questions (Total Marks 45) In this part there are 30 questions each worth 1.5marks. Select what you consider to be the correct answer for each question and mark it on the supplied answer sheet using a lead pencil. Make sure that you put your name and student number on the answer sheet. The question sheet and the answer sheet are to be returned with the rest of the examination paper. A full sample of multiple choice questions is not available for release. The following questions provide an indication of the style of multiple choice questions. 1. What of the following is a valid identifier? A. radius B. 8+9 C. class D. $343 2. What is output by the following code? int x = 2, y = 5; if ((x < 5)="" &&="" (y="" !="5))" system.out.println(x/y);="" else="" if="" ((x=""> 3) || (y < 10))="" system.out.println(x="" –="" y);="" else="" system.out.println(x="" +="" y);="" a.="" 0="" b.="" 1="" c.="" 7="" d.="" -3="" 3.="" analyse="" the="" following="" code.="" boolean="" even="((231" %="" 2)="=" 0);="" if="" (even="=" true)="" system.out.println("it="" is="" even!");="" else="" system.out.println("it="" is="" odd!");="" which="" of="" the="" following="" is="" true?="" a.="" the="" program="" has="" a="" syntax="" error="" b.="" the="" program="" displays="" "it="" is="" even!"="" c.="" the="" program="" has="" a="" run-time="" error="" d.="" the="" program="" displays="" "it="" is="" odd!"="" 4.="" what="" is="" y="" after="" the="" following="" switch="" statement?="" int="" x="0;" int="" y="2;" switch="" (x="" +="" 1)="" {="" case="" 0:="" y="0;" case="" 1:="" y="1;" default:="" y="-1;" }="" a.="" 2="" b.="" 0="" c.="" 1="" d.="" -1="" 5.="" what="" is="" output="" by="" the="" following="" code?="" int="" x="1," y="2;" while="" (x=""><= 11)="" {="" y="" +="2;" x="" +="y" system.out.print(x="" +="" "="" "="" +="" y="" +="" "="" ");="" }="" a.="" 5="" 4="" 6="" 11="" b.="" 5="" 4="" 11="" 6="" 19="" 8="" c.="" 4="" 5="" 6="" 11="" d.="" 3="" 4="" 10="" 8="" 19="" 6.="" what="" is="" output="" by="" the="" following="" code?="" for="" (int="" i="0;" i="">< 5;="" ++i)="" system.out.print(i*2="" +="" ",="" ");="" a.="" 0,="" 1,="" 2,="" 3,="" 4,="" b.="" 0,="" 2,="" 4,="" 6,="" c.="" 0,="" 2,="" 4,="" 6,="" 8,="" d.="" 2,="" 4,="" 6,="" 8,="" 10,="" 7.="" what="" is="" the="" effect="" of="" the="" following="" code?="" int="" balance="10;" while="" (balance=""> =1) { if (balance < 9) break; balance = balance – 9; } a. after the code, balance has the value 1 b. after the code, balance has the value 10 c. after the code, balance has the value -1 d. after the code, balance has the value 2 8. the header of a method is specified as: int func(double x) which of the following expressions or statements contains an illegal method call? a. return func(2); b. func(1+2.2) c. func(func(2.5)) d. system.out.print(func()); 9. what is the output by the following code? char ch1 = 'a'; system.out.println(ch1 + " + 4 is " + (ch1 + 4)); a. a + 4 is e b. a + 4 is 69 c. a + 4 is a4 d. a + 4 is 654 10. the variable tax has been declared of type double and has the value 19.257. for the expression (int)(tax*100)/100.0 which of the following is true? a. it is illegal b. its value is 19 c. its value is 19.25 d. its value is 0.0 11. a programmer has written the following method to swap the values of two arguments passed to it. static void swap(int x, int y) { int temp = x; x = y; y = temp; } which of the following is true for this method? a. it will cause a compilation error b. it will compile and execute as intended c. it will cause a run-time error d. it will cause a logic error 12. a programmer has written a hypotenuse method, which is used as follows: int x = 3, y = 6; double length = hypotenuse(x, y); the header for the hypotenuse method is: 9)="" break;="" balance="balance" –="" 9;="" }="" a.="" after="" the="" code,="" balance="" has="" the="" value="" 1="" b.="" after="" the="" code,="" balance="" has="" the="" value="" 10="" c.="" after="" the="" code,="" balance="" has="" the="" value="" -1="" d.="" after="" the="" code,="" balance="" has="" the="" value="" 2="" 8.="" the="" header="" of="" a="" method="" is="" specified="" as:="" int="" func(double="" x)="" which="" of="" the="" following="" expressions="" or="" statements="" contains="" an="" illegal="" method="" call?="" a.="" return="" func(2);="" b.="" func(1+2.2)="" c.="" func(func(2.5))="" d.="" system.out.print(func());="" 9.="" what="" is="" the="" output="" by="" the="" following="" code?="" char="" ch1='A' ;="" system.out.println(ch1="" +="" "="" +="" 4="" is="" "="" +="" (ch1="" +="" 4));="" a.="" a="" +="" 4="" is="" e="" b.="" a="" +="" 4="" is="" 69="" c.="" a="" +="" 4="" is="" a4="" d.="" a="" +="" 4="" is="" 654="" 10.="" the="" variable="" tax="" has="" been="" declared="" of="" type="" double="" and="" has="" the="" value="" 19.257.="" for="" the="" expression="" (int)(tax*100)/100.0="" which="" of="" the="" following="" is="" true?="" a.="" it="" is="" illegal="" b.="" its="" value="" is="" 19="" c.="" its="" value="" is="" 19.25="" d.="" its="" value="" is="" 0.0="" 11.="" a="" programmer="" has="" written="" the="" following="" method="" to="" swap="" the="" values="" of="" two="" arguments="" passed="" to="" it.="" static="" void="" swap(int="" x,="" int="" y)="" {="" int="" temp="x;" x="y;" y="temp;" }="" which="" of="" the="" following="" is="" true="" for="" this="" method?="" a.="" it="" will="" cause="" a="" compilation="" error="" b.="" it="" will="" compile="" and="" execute="" as="" intended="" c.="" it="" will="" cause="" a="" run-time="" error="" d.="" it="" will="" cause="" a="" logic="" error="" 12.="" a="" programmer="" has="" written="" a="" hypotenuse="" method,="" which="" is="" used="" as="" follows:="" int="" x="3," y="6;" double="" length="hypotenuse(x," y);="" the="" header="" for="" the="" hypotenuse="" method="">
Oct 15, 2020ITC206Charles Sturt University
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here