Objective Testing: Access to Learning Objectives
Total Page:16
File Type:pdf, Size:1020Kb
Learning Objectives: Introduction to Programming
Mark Ratcliffe
CS12230, CS12320, CS12420 and CI12420
1. Introduction On completion of the introductory material, you should be aware of the problems of complexity that face software developers. You should be aware of some of the major software problems that have occurred and the reasons behind them. Most importantly your approach to coding should change in the light of these reported problems.
1.1. Software Crisis On completion of this section, you should have gained an insight into the software crisis and be able to demonstrate an appreciation for a software engineering approach to software development. You should be aware of the need to program in the large
1.2. Information Hiding You should be able to express what is meant by the term Information Hiding, recognising its significance to software development. Information Hiding is a quality which you must be able to demonstrate in the code that you write.
1.3. Abstraction You should be able to express what is meant by the term Abstraction, recognising its significance to software development. Abstraction is a quality which you must be able to demonstrate in the code that you write. Abstraction should also be a feature of teh documentation that you producing accompanying your code.
2. Variables and Types Primitive Types are generally straight forward concepts that are very similar to those in other programming languages. Most important is your ability to distinguish between PrimitiveTypes and Objects. You should be proficient in handling arithmetic operations on Primitive Types. Many students fail to understand the difference betwen passing Primitive Types and Objects to methods. Be careful that you are able to recognise these differences.
2.1. Introduction to Primitive Types On completion of this section, you should be able to distinguish between the primitive types integer, floating point, character and Boolean.
The Discrete Numeric Types: byte, 2.2. short, int and long On completion of this section, you should be able to explain the difference between byte, short, int & long. You should be aware of the storage space that is required of the various types, having an appreciation of their range and overflow characteristics. You should also know, for example, about default literals e.g. the literal 5 is an int.
2.3. The Arithmetic Operators You should be able to apply the arithmetic operators: *, /, +, - to all of the numeric primitive types. You should understand the priority by which operators are handled. A learning objective that is often failed in the ability to recognise the effect of i = x + y++ on both i and y.
2.4. The Modular Operator: % Many students fail to understand the significance of this operator. You must appreciate that it is the remainder function, a facility which is often used in manipulating linear structures in a circular fashion.
2.5. Conversion Between Types You should appreciate the significance of type conversion mechanism in Java. In particular you should be able to distinguish between Implicit type conversion and Explicit type conversion (casting). You should understand when the two situations occur.
Representation of Characters: Unicode 2.6. Values You should be understand how characters are representated using ASCII and have an insight into the Unicode system. You should be able to convert from characters to numerical values and vide versa.
3. Classes and Objects You should be able to distinguish between a Class and an Instance(an Object).
3.1. Composition of a Class You should be able to demonstrate your understanding of the make-up of a class appreciating the purposes of attributes, constructors and methods.
3.2. Modifiers You should be able to express the purpose of class modifiers - public and private.
3.3. The toString() Method You should be able to use toString() appropriately, and be able to implement this method in your own class. This is probably the first example of Overriding that you have seen. It is importand to be able to differentiate between Overloading and Overriding.
3.4. The Predefined Class String It is most important that you appreciate that String is an Object and must be treated as such. You should recognise the various ways in which you can create a String.
3.4.1. Testing for Equality Equality is an area that many people fall down upon. You should appreciate that String is a class and instances cannot be compared using ==.
3.4.2. The length() method Many people forget that length is a method not an attribute of the String class.
3.4.3. Escape Characters You should appreciate that the purpose of embedding special characters in a String is for printing purposes.
3.4.4. Reading in Strings from the keyboard You should understand the standard stream mechanism of Java and be able to instantiate the classes required to be able to successfully read charactrs in from the keyboard.
3.5. The Predefined Class StringBuffer You should be aware that the String class is immutable, that is, you cannot replace a character in a String. Such operations can be carried out by using the StringBuffer class.
4. Statements You should recognise the different types of statements and be able to distinguish between assignment, selectors and iterators.
4.1. Assignment You should appreciate the order by which expressions are evaluated.
4.2. Invocation You should be able to state exactly what happens when a method is called.
4.3. Selectors You should understand the difference between if and switch statements and be able to judge which is most appropriate for use in a given situation. 4.3.1. The if Statement You should be proficient in your use of the if statement, in particular you should be able to explain the impact on the flow of control in the execution of a program.
4.3.1.1. The Ordinal Comparison Operators You should be proficient in using <, <=, >, >= and instanceof.
4.3.1.2. The Logical Operators You should be proficient in using the logical operators, in particular being able to recognise the condition of compound logical operators e.g. if (!((A > B) & (A
4.3.1.3. Short Circuiting You should be able to distinguish between & and && and be able to explain their significance in evaluating a condition.
4.3.2. The switch Statement You should be proficient in your use of the if statement, in particular you should be able to explain the impact on the flow of control in the execution of a program.
4.3.2.1. Type of Expression You should appreciate that the choice expression must be of type char, byte, short or int.
4.3.2.2. The case Values You should be capable of defining multiple case values.
4.3.2.3. The break Statement You should be aware of the significance of the presence/absence of a break after a case value.
4.4. Iterators You should understand the difference between the various loop statements and be able to judge which is most appropriate for use in a given situation
4.4.1. The for Loop You should appreciate the use of the for statement understanding the effect that such a statement will have on enclosed code.
4.4.1.1. The for Loop Structure You should recognise the purpose of each of the statements inside the definition of the for statement: declaration & initialisation; conditional to be evaluated to determine whether to execute the body; statement to be executed ater the body. You should appreciate that all parts are optional.
4.4.2. The while Loop
4.4.3. Exiting a Loop Prematurely You should be able to differentiate between the break (leave the loop) and continue(go to next iteration) statements, and their significance on the execution of a loop statement.
5. More on Classes
5.1. Class Variables You should be able to recognise a Class Variable (static) and appreciate the significance of such a variable, deonstrating how its value is maintained through all instances.
5.2. Method Calling Passing Primitives
5.3. Method Calling Passing Objects 5.4. Duplicating Objects You should be able to distinguish between a Shallow and a Deep copy of an object.
5.5. The variable - this You should be able to explain the purpose of - this - realising its significance within a method.
5.6. The Lifetime of an Object You should appreciate when an Object can be freed by the Garbage Collector, in particular you must know that this is beyond the control of the programmer but that an Object can be released when its last link is removed.
5.7. Packaging up a Class You should be capable of putting a class into a package and be able to access it from elsewhere. You must appreciate the significance of the package statement, the import statement and the classpath environment variable.
6. Inheritance You should be able to recognise when inheritance in appropriate in software design. You should be aware of the advantages that inheritance has to offer the software engineer.
6.1. Definitions You should be able to define what is meant by the terms subclass, derived class, superclass, base class and parent class. You should also be able to define what is meant by generalising and specialising.
6.2. The extends Statement You should appreciate what happens to a class when it extends another. You should recognise that all classes extend Object by default.
6.3. Calling the Parent Constructor You should be able to explain the use of super() and appreciate why it is not always necessary.
6.4. Overriding a method You should be able to distinguish overriding from overloading.
6.5. Access Rights and Modifiers You should be able to explalin how public and private modifiers can affect access within a subclass. You should be able to justify why protected might be used as an alternative and you should be able to convey the effect that such an modifier will have on access rights.
6.6. Abstract Classes You should be able to recognise the purpose of an Abstract Class.
7. Exceptions to be completed......
8. Stream Handling to be written.....