Object Oriented Programming - Advanced Application Development - Exam, Exams of Management Information Systems

Object Oriented Programming, Fundamental Concept, Inheritance and Provide, Simple Descriptive, Simple Code that Demonstrates, Relationship, Eclipse Project, Implement Encapsulation, Auto Sales, Constructor with Parameters are some points of course of Advanced Application Development.

Typology: Exams

2011/2012

Uploaded on 11/24/2012

divye
divye 🇮🇳

4.6

(12)

92 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Semester 2 Examinations, 2010/2011
Exam Code(s)
2BF1
Exam(s)
BSc in Business Information Systems Year 2
Module Code(s)
MS221
Module(s)
Advanced Application Development II
Paper No.
Repeat Paper
N
Special Paper
External Examiner(s)
Dr. Danail Ivanov
Internal Examiner(s)
Dr. Christopher Duke, Mr Martin Hughes
Instructions:
Candidates are required to answer all questions. Marks will
be awarded for commented code. Marks will be deducted for
code that does not adhere to standard Java and JavaBean
naming conventions.
Duration
2 Hrs
No. of Answer books
Requirements:
Handout
MCQ
Statistical Tables
Graph Paper
Other Material
No. of Pages
4
Department(s)
Business Information Systems
pf3
pf4

Partial preview of the text

Download Object Oriented Programming - Advanced Application Development - Exam and more Exams Management Information Systems in PDF only on Docsity!

Semester 2 Examinations, 2010/

Exam Code(s) 2BF Exam(s) BSc in Business Information Systems Year 2 Module Code(s) MS Module(s) Advanced Application Development II Paper No. Repeat Paper N Special Paper N External Examiner(s) Dr. Danail Ivanov Internal Examiner(s) Dr. Christopher Duke, Mr Martin Hughes

Instructions: Candidates are required to answer all questions.^ Marks will

be awarded for commented code. Marks will be deducted for code that does not adhere to standard Java and JavaBean naming conventions. Duration 2 Hrs No. of Answer books Requirements : Handout MCQ Statistical Tables Graph Paper Other Material No. of Pages 4 Department(s) Business Information Systems

Please note:

Please create a new Eclipse project for every question (e.g. The project

for Question 1 should be called Question1).

Unless otherwise stated, your code should reside in the src folder of

your project in a package called ie.nuigalway.ms

For every class that you create, include your name and ID number as

comments in the first few lines of the code

All Questions Are Compulsory

Question 1: 30 Marks Part A 6 Marks Inheritance is a fundamental concept in Object Oriented programming. List the two most common reasons to use inheritance and provide a simple descriptive example of each. Part B 12 Marks Create a new package in the src folder of your Question1 Eclipse project called ie.nuigalway.is_a and write some simple code that demonstrates the two ways in which an IS-A relationship can be created in Java. In your answerbook, provide a brief explanation of how your code demonstrates an IS-A relationship. Part C 6 Marks Create a new package in the src folder of your Question1 Eclipse project called ie.nuigalway.has_a and write some simple code that demonstrates a HAS-A relationship. In your answerbook, provide a brief explanation of how your code demonstrates a HAS-A relationship. Part D 6 Marks With reference to class members (methods and instance variables), explain how access modifiers can be used to implement encapsulation.

Question 3: 35 Marks You have been taken on as a contract programmer at Agile Developers Ltd. The company is currently developing a student record system for NUI Galway. Your task is to develop the Student class and your manager has provided you with the JUnit test class below. Your task is to write the production code that will make all of the tests pass. import junit.framework.TestCase; public class StudentTest extends TestCase { /**

  • Creating a student object to use in all tests / Student theStudent = new Student("John", "Doe", 76568, Course. BIS); /*
  • Test the constructor using the toString method / public void testConstructor() { assertEquals("John Doe has an id of 76568", theStudent.toString()); } /*
  • Test the setFirstName method and the getFirstName method / public void testSetFirstName() { theStudent.setFirstName("Mary"); assertEquals( "Mary", theStudent.getFirstName() ); } /*
  • Test the setLastName and the getLastName methods / public void testSetLastName() { theStudent.setLastName("Scott"); assertEquals("Scott", theStudent.getLastName()); } /*
  • Test the setId and getId methods / public void testSetId() { theStudent.setId(87676); assertEquals(87676, theStudent.getId()); } /*
  • Test the setCourse and getCourse methods */ public void testSetCourse() { theStudent.setCourse(Course. COMMERCE); assertEquals(Course. COMMERCE, theStudent.getCourse()); } }