




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about the autumn examinations in 2008/2009, including exam codes, modules, and instructions for candidates. The exams cover masters of business studies in electronic commerce and higher diploma in systems analysis, with interactive programming as a module. Candidates are required to answer multiple-choice questions and set rates for currencies in the autumn class.
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Exam Code(s) 1AE1, 1 BD1, 1 BD Exam(s) Masters of Business Studies in Electronic Commerce Higher Diploma in Systems Analysis full-time Higher Diploma in Systems Analysis part-time Module Code(s) MS84 1 Module(s) Interactive Programming II Paper No. Repeat Paper External Examiner(s) Professor H. van der Heijden Internal Examiner(s) Professor J. F. Collins Mr. Seamus Hill Instructions: Candidates are required to answer: Section A (20 Marks) Answer all 10 parts of section A, This section consists of 10 multiple-choice questions all of which should ideally be attempted. Answers are to be written on the MCQ sheet provided, NOT on the Examination paper. Section B (80 Marks) Answer Any Two Questions Duration 3 hrs Department(s) Accountancy & Finance Course Co-ordinator(s) Requirements : MCQ Yes, Type a-d
Review the following class and explain the purpose of the class and how it works. Explain, line by line, the purpose of the class and each of its methods. Use the line numbers for reference purposes. 1 public class Autumn { 2 3 private String[] curNames; 4 private double[] curRates; 5 private int count; 6 7 public Autumn() { 8 count = 0; 9 curNames = new String[ 20 ]; 10 curRates = new double[ 20 ]; 11 } 12 13 public void setRate( String currencyName, double rate ) { 14 15 int index = - 1; 16 17 for ( int i = 0; i < count; i++ ) { 18 if ( curNames[ i ].equals( currencyName ) ) { 19 index = i; 20 } 21 } 22 23 if ( index != - 1 ) { 24 25 curRates[ index ] = rate; 26 } else { 27 28 if ( count == curRates.length ) { 29 30 enlarge(); 31 } 32 33 curNames[ count ] = currencyName; 34 curRates[ count ] = rate; 35 count++; 36 } 37 } 38 ...continued
39 public double exchange( String fromCurrency, String toCurrency, 40 double amount ) { 41 42 double retVal = - 1.0; 43 44 if ( fromCurrency.equals( toCurrency ) ) { 45 46 retVal = amount; 47 } else if ( fromCurrency.equals( "dollar" ) ) 48 49 int index = currencyLocation( toCurrency ); 50 51 if ( index == - 1 ) { 52 53 System.out.println( toCurrency + " cannot be found in the " + 54 "exchange rates." ); 55 } else { 56 retVal = amount * curRates[ index ]; 57 } 58 59 } else if ( toCurrency.equals( "dollar" ) ) { 60 61 int index = currencyLocation( fromCurrency ); 62 63 if ( index == - 1 ) { 64 System.out.println( fromCurrency + " cannot be found in the " 65 + "exchange rates." ); 66 } else { 67 retVal = amount / curRates[ index ]; 68 } 69 70 } else { 71 72 int index1 = currencyLocation( fromCurrency ); 73 int index2 = currencyLocation( toCurrency ); 74 boolean found = true; 75 76 if ( index1 == - 1 ) { 77 System.out.println( fromCurrency + " cannot be found in the " 78 + "exchange rates." ); 79 found = false; 80 } 81 82 if ( index2 == - 1 ) { 83 System.out.println( toCurrency + " cannot be found in the " 84 + "exchange rates." ); 85 found = false; 86 } ...continued
Given the class Tester, illustrate how the pass-by-value scheme works for the code segment given. Your answer should include a state of memory diagram to show the flow of execution and allocation and deallocation of memory. public class Tester { public void myMethod( int one, double two){ one = 25; two = 35.4; } } Tester tester; int x,y; tester = new Tester(); x = 10; y = 20; tester.myMethod(x,y); System.out.println(x + " " + y);
Write a program that replies either Leap Year or Not a Leap Year, given a year. Use the following code to calculate whether a year is a leap year or not. if ( year % 4 == 0 ) { if ( year % 100 != 0 ) { leap = true ; } else if ( year % 400 == 0) { leap = true ; } } You answer should consists of two files, a programmer defined class called LeapYear class, which can determine whether or not a given year is a leap year. And an application class called IsLeapYear, to determine whether a given year is a leap year or not, this main class uses the reusable class LeapYear to determine the “leapness” of the year.
In relation to object-oriented programming with JAVA, detail your understanding, using examples/analogies where appropriate, of each of the following: i. Polymorphism, ii. Overloaded Constructors iii. Inheritance iv. Pass by reference and pass by value.
Define each of the following terms exception thrower , exception catcher and exception propagator.
Briefly discuss, using examples/analogies where appropriate, the following statement - Public methods of a class determine the behaviour or its instances. Internal details are implemented by private methods and private data members.