



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: Starter, Substring Method, integer Array, Private Procedure, Object Oriented Programming, instance, Sequential Execution, Concurrent , Execution, Merit
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




(NFQ Level 6)
Section A: This question must be answered.
Section B: Choose 1 question
Section C: Choose 1 question
Examiners: Ms.D. Dunlea Mr. J. Greenslade Mr. J. Walsh
Q1) Write a menu program for the HI Café. The following is the list of food on offer:
HI Cafe Starter Fruit juice 2. Soup 4. Cold meat salad 7. Main Course Sausages (2) 4. Bacon & egg 5. Cod 8. Place 9. Steak 15. Desert Ice Cream 6. Pavlova 7. Beverages Tea 0. Coffee 1. All prices exclude VAT
The meals in the HI Café are categorized into four courses: starter, main course, desert and beverages. Using private procedures write a program that presents this information to the customer and allows the customer to choose the dishes they want from each category. The first category they must choose from is “Starter”. When they are finished choosing from this menu they choose the exit option and are then presented with the “Main Course” menu etc. You must then create a final bill to be output to the screen that includes the name of the individual’s choice, the price and the sub-total. On the next two line output the value added tax at 15% and then the total for the meal. [40 marks]
2 a) Explain in detail the workings of the following program. What type of program is this? [10 marks]
import java.io.*; import EasyIn;
class CallDown { public static void main(String args[]) { int num = 0; System.out.print("Please enter a number: "); num = EasyIn.getInt(); countDownFrom(num); }
private static void countDownFrom(int x) { System.out.println(x); --x; if (x >= 0) countDownFrom(x); } }
2 c) Look at the short Java program listed below. One block of the program is missing. Your challenge is to match the candidate block of code (on the left), with the output that you’d see if the block were inserted. Not all the lines of output will be used, and some of the lines of output might be used more than once. Draw lines connection the candidate blocks of code with their matching command-line output [12 marks]
class Test { public static void main(String [] args) { int x = 0; int y = 0; while(x<5) { ==+++====+++=== BLOCK HERE =====+++===+++ System.out.print(x + ““ + y + “ “); x = x + 1; } } } Candidates: Possible output:
3 d) What is meant by the term “reusability” in relation to Object Oriented Programming and why is it so important? [6 marks]
4 a) Write the code for the following class: [20 marks]
4 c) Write a main application to create student A below:
Student A 45688H Luke O’ Brien Maths = 63 English = 89 Science = 55
Now output the students details on the screen. [1[ 10 0 mmaarrkkss]]
5 a) Write a program that will allow a teacher to input examination marks at a keyboard for 20 students. Once all examinations marks have been entered into the computer, she must display the mark and grade for each of the 20 students.
Example: “Student 1 received a mark of 60 and a pass grade”
Student
sNumber: String sName : String mathsMark : int englishMark : int scienceMark : int
Student(String, String) getName( ): String getMathsMark(): int setName(String) setMathMark(int) setEnglishMark(int) setScienceMark(int) calculateAverageMark() : double print()
On the first line print the student number and name. On the second line print the subject name and mark. On the third line print the average mark received.
“Student 2 received a mark of 72 and a merit grade”
The grade distribution is shown in the following table:
Mark range Grade 100-85 distinction 84 - 65 merit 64 – 40 pass 39-0 fail
Note: An ARRAY must be used to hold the 20 student results. Use worker methods where necessary [20 marks]
5 c) Using examples explain the following terms?
Class [3 marks]
Instance [3 marks]
Explain the following two terms – sequential execution and concurrent execution. [2 marks]
What is a constructor? Give examples [2 marks]