{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSI1100_F04_Exam - CSI 1100 1500 Final Examination Page 1...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSI 1100 / 1500 Final Examination Page 1 of 13 CSI 1100 / 1500 Fall 2004 Introduction to Computer Science I Final Examination Duration : 3 hours 09:30 December 9, 2004 Professors: Alan Williams, Daniel Amyot Page 1 of 13 Full name (please print): Student number: Instructions – please read carefully! Fill out the identification information above in ink. This exam is closed-book. No books, papers, calculators, or other electronic devices are permitted. There are 7 questions in this exam, some of which have sub-parts. Answer the questions in the space provided. Answers written in pencil will not be re-graded even if there is a marking error. The marks allocated to each question are provided. Not all questions are worth the same, so plan your time accordingly. The exam has 100 marks in total, which represents 55% of your final grade. Algorithms in pseudocode should use the format from the course notes. You can use the back of pages for calculations and rough work, as well as page 12. Pages 12 and 13 can be detached and will not be graded. Les réponses en français sont acceptées. Question Marks Marks received Question Marks Marks received 1 12 5 15 2 8 6 25 3 15 7 10 4 15 Total 100
Image of page 1

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

View Full Document Right Arrow Icon
CSI 1100 / 1500 Final Examination Page 2 of 13 Question 1A) (4 marks) In this question, use only the following ( pseudocode ) Boolean expressions: comparison operators: <, >, =, ±² ±² and Boolean connectors: NOT, AND, OR arithmetic operators: +, -, *, /, and MOD (modulo) variable names and constants. Use parentheses where necessary. Do not use Java syntax! Environment Canada will report a humidex value as part of a weather forecast if the temperature (T) is greater than or equal to 30 degrees, if the temperature is greater than or equal to 25 degrees and the humidity (H) is greater than 35%, or the temperature is greater than or equal to 20 degrees and the humidity is greater than or equal to 65%. Write a Boolean expression that is true if Environment Canada will report a humidex value, and false otherwise. Answer: Question 1B) (4 marks) Consider the following Java program : MyClass[] obj; int index; obj = new MyClass[2]; index = 15; while( index > 2 ) { obj[index % 2] = new MyClass( ); index = index / 2; } // Line X i) How many instances of MyClass are created during the execution of this program? (2 marks) Answer: ii) How many instances of MyClass are still accessible at Line X? (2 marks) Answer:
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern