



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
These are the Old Exam of Software Development which includes Primenumber, Palindrome, Payrate, String Responsibility, Double Payrate, Double Time, String Name, Private Double Calculatepay, Public Void Displaydetails etc.Key important points are: Rate interest, Software Development, Payrate, Public Job, String Responsibility, Double Payrate, String Getresponsibility, Vector, Bankaccount, Savingsaccount
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!




(NFQ Level 7)
Instructions Answer Four questions. All questions are worth equal marks
Examiners: Mr. G. MacSweeney Mr. J. Greenslade Mr. J. Walsh
Write an applet which prompts a user to enter an amount and a rate of interest for a loan. The program should calculate the total repayment for the year and display the monthly repayments.
The monthly repayment can be calculated by:
monthly repayment = (amount + (amount x interest rate) / 100) / 12
( 25 Marks )
a) In Java, what is meant by association? ( 2 Marks )
b) Write a Job() class with the following attributes, constructor and methods:
attributes: responsibility, payRate, time
constructor: public Job(String responsibility, double payRate, double time)
methods: public double getPayRate() public double getTime() public String getResponsibility() ( 6 Marks )
c) Write an Employee() class with the following attributes, constructor and methods:
attributes: name, newJob
constructor: public Employee(String name, Job newJob)
methods: private String displayName() private double calculatePay() public void displayDetails() ( 6 Marks )
d) Write an example program which incorporates the above classes. ( 6 Marks )
e) In java, what is a Vector()? ( 2 Marks )
f) Suggest an advantage of using Vector() instead of an array? ( 3 Marks )
a) Write a frame which displays the canvas for a simple calculator as follows:
In your answer, include appropriate layout managers and panels. You do not need to include the ActionListener interface. ( 15 marks )
b) State three reasons why a developer might choose an object orientated language. ( 6 marks )
c) State two reasons why a developer might reject using an object orientated language. ( 4 marks )
a) Write the code to define the class Person() which includes code for the following methods:
Decide what data variables are required, arguments for methods, etc. ( 8 Marks )
b) Write a program to create an array of ten Person() objects and read ten names and ages into the array from the file people.dat.
The first part of the code is as follows:
import java.io.*; public class Test1 { public static void main( String args[] ) throws IOException {
File f = new File("people.dat"); FileInputStream fs = new FileInputStream(f); InputStreamReader isr; BufferedReader fileInput; isr = new InputStreamReader(fs); fileInput = new BufferedReader(isr); ……. ( 8 Marks )
c) Write a piece of code which sorts the items from the array into order the youngest first. ( 9 Marks )