Study Guides (238,613)
Canada (115,253)
York University (9,816)
ITEC 1620 (17)


15 Pages
Unlock Document

York University
Information Technology
ITEC 1620
Stephen Chen

York UniversityASAKITEC 1620 30Section AOBJECTBASED PROGRAMMINGSummer 2002Final ExamExaminer SY Chen Duration Two HoursThis exam is closed textbooks and closed notes Use of any electronic device eg for computing andor communicating is NOT permittedDo not unstaple this test bookany detached sheets will be discardedAnswer all questions in the space provided No additional sheets are permittedWork independently The value of each part of each question is indicated The total value of all questions is 100Write your name and student number in the space below Do the same on the top of each sheet of this exam where indicatedNOTE YOU MAY USE PEN OR PENCIL Surname Given NamesStudent Number Question 1 15 marksControl StructuresWrite a static method in JAVA that will determine if the passed parameters represent a valid triangleEach parameter represents the length of one side of the triangle and the method returns true if the sides can form a valid triangle and false otherwiseA valid triangle has all sides greater than 0 in length and each side must be shorter than the total length of the other two sidesFor example the following statements would lead to the underlined output Example 1Yorkprintln isValidTriangle 3 4 7 falseExample 2Yorkprintln isValidTriangle 3 4 5 trueExample 3Yorkprintln isValidTriangle 3 0 5 falseExample 4Yorkprintln isValidTriangle 10 1 10 trueExample 5Yorkprintln isValidTriangle 8 4 1 falsePlease write your method on the following page You may use this page for rough work but anything on this page will not be graded
More Less

Related notes for ITEC 1620

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.