Question One
Differentiate between source code, source file and byte code; demonstrate this using a suitable example.
(5 marks)
List the three categories of variables; hence show how a variable is declared in Java using a suitable example
(4 marks)
Using three steps describe how to create an array of data items; hence show this using an example of your choice.
(5 marks)
List four items you need to declare a method of Java.
(4 marks)
Differentiate between the “is – a” and “has – a” relationship in Java, giving a suitable example of each.
(4 marks)
What does the term loose coupling mean in object oriented programming? Hence list three advantages of loose coupling.
(4 marks)
List two ways of handling exceptions
(2 marks)
Differentiate between method overriding and method overloading (2 marks)
SECTION B:
Answer any two questions from this section
Question Two
Seafaring Ltd is running a promotion for all their customers. When a customer makes a purchase for electric goods the system awards the customer 10% of the purchase value as points. In reality, however, the customer is awarded 40% in points of the profit on that particular sale. Non-electric goods are not awarded any points. At the end of the promotion period customers who have accumulated over 1000 points will all be awarded random rewards. The management are concerned that this little trick they are using will be discovered when a customer called Mutua who is IT savvy comes calling. Write a program that will allow Mutua to enter all his sales for the month show him his points as 10% of purchase price but still award him points based on the 40% rule. i.e. what it displays and what it stores are different values.
For a custom-written paper on the above topic, place your order now!
What We Offer
• On-time delivery guarantee
• PhD-level professionals
• Automatic plagiarism check
• 100% money-back guarantee
• 100% Privacy and Confidentiality
• High Quality custom-written papers