Docsity

Exam Paper for Business Application Development III, 2010/2011, Exams of Software Development

Toggle sidebar
bg1
Semester 2 Examinations, 2010/2011
Exam Code(s)
2BF1
Exam(s)
BSc in Business Information Systems Year 2
Module Code(s)
MS215
Module(s)
Business Application Development III
Paper No.
Repeat Paper
Y
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.
Duration
3 Hrs
No. of Answer books
Requirements:
Handout
MCQ
Statistical Tables
Graph Paper
Other Material
No. of Pages
5
Department(s)
Business Information Systems
pf3
pf4
pf5

Partial preview of the text

Download Exam Paper for Business Application Development III, 2010/2011 and more Exams Software Development 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 215 Module(s) Business Application Development III Paper No. Repeat Paper Y 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. Duration 3 Hrs No. of Answer books Requirements : Handout MCQ Statistical Tables Graph Paper Other Material No. of Pages 5 Department(s) Business Information Systems

Please note: 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: 25 Marks You have been asked to write a simple GUI application that allows a user to enter the following information about an Employee:

  • Firstname (String)
  • Lastname (String)
  • Age (int)
  • PPS Number (String) The main application window should look like this: When the user presses the Print button, the application should show a message dialog that displays the employee's information like this: If the user does not enter a valid integer for age, your application should warn the user with the following message:
  • An overridden toString method that will format the Employee object data for output as follows: Employee Joe Bloggs has a weekly salary of 250 Euro Part D 15 Marks Modify the Invoice and Employee classes so that they both implement the Payable interface. In the Invoice class, the getPaymentAmount method should return the result of the quantity multiplied by the price per item. In the Employee class, the getPaymentAmount method should return the employee's weekly salary. Part E 15 Marks Write a driver class called TestPayments that does the following:
  • Creates an Invoice object with a part number of 342, part description of “Dell Laptop”, quantity of 3 and price per item of 860.
  • Creates an Employe object with a firstname of “Joe”, a lastname of “Bloggs” and a weekly salary of 250.
  • Prints a string representation of the Employee object.
  • Uses polymorphism to print the payment amount for each object.

import java.io.File; import java.io.FileNotFoundException; import java.io.Serializable; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.io.IOException; import java.io.EOFException; import java.lang.SecurityException; import java.lang.IllegalStateException; import java.util.Formatter; import java.util.FormatterClosedException; import java.util.NoSuchElementException; import java.util.InputMismatchException; import java.util.Scanner; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField;