Software Systems Development Unit AS1: Introduction to Object Oriented Development

Similar documents
Cambridge International Examinations Cambridge Ordinary Level

Introduction to Programming Using Java (98-388)

C++ Programming Fundamentals

CO Java SE 8: Fundamentals

ADVANCED General Certificate of Education Software Systems Development Unit AS 1. Introduction to Object Oriented Development [SDV11]

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci)

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

Information and Communication Technology Level 1

Exam Duration: 2hrs and 30min Software Design

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING

Unit 1 Computer Systems, Programming and Networking Concepts

JAVA MOCK TEST JAVA MOCK TEST II

Topic 7: Algebraic Data Types

Information and Communication Technology Level 2

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

Chief Reader Report on Student Responses:

October/November 2005 READ THESE INSTRUCTIONS FIRST

Module Contact: Dr Gavin Cawley, CMP Copyright of the University of East Anglia Version 1

Final Exam Practice. Partial credit will be awarded.

Chapter 4: Writing Classes

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Information and Communication Technology Level 2

Arrays Classes & Methods, Inheritance

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L

CS121/IS223. Object Reference Variables. Dr Olly Gotel

Information and Communication Technology Level 2

Object-Oriented Design (OOD) and C++

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Module Contact: Dr Geoff McKeown, CMP Copyright of the University of East Anglia Version 1

Object Oriented Programming. Solved MCQs - Part 2

Short Notes of CS201

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level

CE221 Programming in C++ Part 1 Introduction

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

COMPUTER APPLICATIONS

Data Structures and Algorithms in Java. Second Year Software Engineering

Java Object Oriented Design. CSC207 Fall 2014

CS201 - Introduction to Programming Glossary By

Distributed Systems Recitation 1. Tamim Jabban

ECE 122. Engineering Problem Solving with Java

Inheritance: Develop solutions by abstracting real-world object and their interaction into code to develop software solutions. Layering: Organization

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level

Announcements/Follow-ups

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level COMPUTING

6.096 Introduction to C++ January (IAP) 2009

Inheritance. COMP Week 12

a) Answer all questions. b) Write your answers in the space provided. c) Show all calculations where applicable.

CmSc 150 Fundamentals of Computing I. Lesson 28: Introduction to Classes and Objects in Java. 1. Classes and Objects

Ministry of Higher Education Colleges of Applied Sciences Final Exam Academic Year 2009/2010. Student s Name

Information and Communication Technology Level 1

Applied Information and Communication Technology Assessment Unit A2 13

Computing Science. Advanced Higher. Finalised Marking Instructions

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal

CGS 2405 Advanced Programming with C++ Course Justification

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

COP 3330 Final Exam Review

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018)

COMPUTER APPLICATIONS

Tuesday 14 June 2016 Afternoon Time allowed: 1 hour 15 minutes

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level

Polymorphism. return a.doublevalue() + b.doublevalue();

Object Oriented Programming with Java

Tuesday 29 January 2013 Morning

CSC207H: Software Design. Java + OOP. CSC207 Winter 2018

Java Programming. MSc Induction Tutorials Stefan Stafrace PhD Student Department of Computing

Cambridge International Examinations Cambridge International Advanced Level

Framework Fundamentals

Chapter 1 Getting Started

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

Unit 1 Part 2 Data Response: Markets and Market Failure

C++ Important Questions with Answers

Inheritance and Polymorphism

CSCU9T4: Managing Information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Do not open this examination paper until instructed to do so. Section A: answer all the questions. Section B: answer all the questions.

And Even More and More C++ Fundamentals of Computer Science

Motivation was to facilitate development of systems software, especially OS development.

Chapter 1: Object-Oriented Programming Using C++

Syllabus of C++ Software for Hands-on Learning: This course offers the following modules: Module 1: Getting Started with C++ Programming

Industrial Programming

What is an Object. Industrial Programming. What is a Class (cont'd) What is a Class. Lecture 4: C# Objects & Classes

IT101. Inheritance, Encapsulation, Polymorphism and Constructors

AP Computer Science Chapter 10 Implementing and Using Classes Study Guide

Computer Science II (20073) Week 1: Review and Inheritance

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

Inheritance, Polymorphism, and Interfaces

A Java Execution Simulator

CSC Java Programming, Fall Java Data Types and Control Constructs

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

BEng (Hons) Telecommunications. Examinations for 2016 / Semester 2

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

CHAPTER 7 OBJECTS AND CLASSES

1B1b Classes in Java Part I

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level and Advanced Level

Transcription:

New Specification Centre Number 71 Candidate Number ADVANCED SUBSIDIARY (AS) General Certificate of Education 2014 Software Systems Development Unit AS1: Introduction to Object Oriented Development [A1S11] TUESDAY 20 MAY, AFTERNOON TIME 2 hours. INSTRUCTIONS TO CANDIDATES Write your Centre Number and Candidate Number in the spaces provided at the top of this page. Write your answers in the spaces provided in this question paper. Answer all questions. INFORMATION FOR CANDIDATES The total mark for this paper is 100. Figures in brackets printed down the right-hand side of pages indicate the marks awarded to each question or part question. ADVICE TO CANDIDATES You are advised to take account of the marks for each part question in allocating the available examination time. 9562 For Examiner s use only Question Available Number 1 10 2 23 3 21 4 23 5 9 6 14 Total 100 s

1 Complete the following definitions within an object-oriented programming environment by inserting the appropriate word from the list given below. A word may be used only once. multiple reuses implementation related single type encapsulation implements characteristics static instantiation behaviour Classes describe the of objects, while objects are usable instances of classes. The act of creating an object is called. Inheritance, together with and polymorphism, is one of the three primary (or pillars) of object-oriented programming. Inheritance enables you to create a new class that, extends, and modifies the that is defined in another class. Encapsulation means that a group of properties, methods, and other members are treated as a unit or object. Polymorphism means that you can have classes that can be used interchangeably, even though each class the same properties or methods in different ways. [10] 9562 2

2 (a) Methods or Functions are common features of programs. Explain the structure of a Method or Function referencing the two examples given below to illustrate your answer. public static int enter_no_of_items( int min, int max) public static void displaymessage( int row, int col, String message) [6] 9562 3 [Turn over

(b) Write the body of code for the method: public static int enter_no_of_items( int min, int max) which will allow the user to enter a value for the number of items bought. The value should be validated in the range min to max. Your answer should include: data declaration; prompt and Input statements; range check; error message control. [8] 9562 4

(c) Write the body of code which will validate a telephone number for the method: C# public static bool validtelephoneno( String telno) Java public static boolean validtelephoneno( String telno) to ensure that: the telephone number has a minimum length of nine characters; the first character may be the + character; all characters must be digits with the possible exception of the first character; the method should return true or false. Your answer should include: data declaration; length check; + character check; digit check; true / false returned. 9562 5 [Turn over [7]

(d) Write the code in the class method main() for the call statements to the two methods below: C# public static int enter_no_of_items( int min, int max) public static bool validtelephoneno( String telno) Java public static int enter_no_of_items( int min, int max) public static boolean validtelephoneno( String telno) Assume the following variables have been declared and the telephone number, telno, has been assigned a value: noofitems as type integer; telno as type string; validtelno as type boolean; min as type integer; max as type integer. [2] 9562 6

BLANK PAGE (Questions continue overleaf) 9562 7 [Turn over

3 A company that specialises in gourmet food determines the delivery charge for a hamper of food by the weight of the hamper. Each hamper is weighed and assigned a standard delivery charge according to its weight as follows: Weight (kg) Standard delivery charge ( ) greater than 15 16 between 10 and 15 inclusive 10 between 5 and 9.99 inclusive 4.25 less than 5 2.50 * The delivery charge is increased by 30% if next day delivery is required. (a) Complete the design of a class called Hamper shown below. Ensure the creation of: A constructor method with fields; GET and SET (Properties / Methods); A Method to determine delivery cost (standard delivery charge + next day charge). class Hamper{ private double weight; private char nextdaydelivery; public Hamper( ) { weight = 0; nextdaydelivery = ; } // field constructor 9562 8 [3]

// GET and SET (Properties/Methods) [6] // A method to determine delivery cost [8] 9562 9 [Turn over

(b) Write the code, in the class method main(), to instantiate an object of type Hamper and output the cost of delivery for the object. Assume the following variables have been declared and assigned values. double char hamperweight; nextdaydelivery; instantiate object [2] output cost of delivery for the hamper [2] 9562 10

4 An array is a static structure which is efficient in the processing of large amounts of data. (a) Describe an array structure clearly identifying: three key aspects; how an array can be instantiated; how the first item within an array structure can be accessed. [5] 9562 11 [Turn over

(b) An array structure rainfall is used to store the rainfall figures (in millimetres) over a period of one week, as shown below. 6 10 17 2 0 12 7 Assuming that the array has been instantiated with the figures, write the code that will: calculate the average rainfall for the week; output the number of days with below average rainfall. [7] 9562 12

(c) Searching is often carried out on arrays. The linear method shown below exits if the required number is found or if the search reaches the end of the array. public static int search( int[ ] nums, int numrequired) { for ( int x=0; x <nums.length; x++ ) { if ( nums[x] = = numrequired ) return x; } return - 1; } (i) Arrays may be sorted to improve the search times. What improvement could be made to the linear search method above if the array passed as a parameter has the figures sorted in numerical order? [2] 9562 13 [Turn over

(ii) Discuss why a linear search method might not be effective for a large array of sorted numbers and why the binary search method would improve efficiency. [3] 9562 14

(iii) Using the diagram below: (1) fill in the missing values to illustrate how the binary search would be implemented for the array when the target number to be found is 30. [5] (2) Fill in the expression which will terminate the search if the target number is not in the array. [1] (1) Target number to be searched for = 30 4 6 10 17 21 30 42 Start = 0 mid = ( i ) last = ( ii ) 4 6 10 17 21 30 42 Start = ( iii ) mid = ( iv ) last = ( v ) (2) Terminate search if target found or last start (target not in array) 9562 15 [Turn over

5 Explain how each of the following facilitates inheritance in classes (object templates). encapsulation overloading overriding [6] 9562 16

Give three advantages of inheritance. advantage 1 advantage 2 advantage 3 [3] 9562 17 [Turn over

6 As part of an IT application for an Art Exhibition gallery, software is required to manipulate the sale of paintings and sculptures. The software collects details about the artwork such as its title and price. The diagram below shows the data structures. ArtWork int String double String artworkno title price artist Painting Sculpture double length String material double breadth double height String medium double weight Assume that the class ArtWork has been designed with the following: field definitions; default and field constructors; GET and SET (Properties/Methods); tostring() method. (a) Using the concept of inheritance, define the class Sculpture. Ensure the creation of: fields; constructors; GET and SET (Properties / Methods); a tostring() method to return full details of the sculpture. 9562 18

9562 19 [Turn over [10]

(b) (i) Define an array named, artworksarray, that is capable of holding details for 50 items of Artwork. [2] (ii) Populate artworksarray[0] with sample details of a sculpture. artworksarray[0] = [2] THIS IS THE END OF THE QUESTION PAPER 9562 20

Permission to reproduce all copyright material has been applied for. In some cases, efforts to contact copyright holders may have been unsuccessful and CCEA will be happy to rectify any omissions of acknowledgement in future if notified. 113166