Paper 1 (Questions) Flashcards
Difference between the usage of same method identifier and polymorphism overridinig:
Polymorphism overriding includes inheritence, while using the same method idenfiter in a different class allows you to create objects using the class, therefore the compiler will know which method to use by calling on the class which the object was created from.
Example:
lass Animal {
public void speak () {
System.out.println(“Animal speaks”)); }
}
class Dog {
public void speak(()
{ System.out.println(“Dog barks”)); } }
In this example, there are two methods with the same name speak, one in the Animal class and one in the Dog class. However, there is no conflict between them because each method is defined within its own class. When you call the speak method on an object of the Animal class, the Animal class’s speak method will be called, and when you call the speak method on an object of the Dog class, the Dog class’s speak method will be called.
Define the term bit.
Bit is a Binary digit;
Outline what is meant by beta testing.
Involves sending sample software to the intended audience;
(Selected audience do not pay for this software);
To try/use the software product;
And give the feedback to the authors (which help in correcting bugs);
Identify two additional features of a word processing package that could be useful for
this office.
Then
Outline the purpose of one application software package other than a word processing package that could be used in this office.
Identify two additional features of a word processing package that could be useful for
this office.
Insert (tables/pictures/graphs/formulas/…);
Mail merge;
Macros;
Print;
Etc.
Outline the purpose of one application software package other than a word processing package that could be used in this office.
Spreadsheet;
For graphically presenting various data;
Database software;
For holding employees/customers data;
Outline one problem that may arise from the installation of new hardware and software
in the office.
ompatibility Issues:
One common problem that arises from the installation of new hardware and software is compatibility issues. This occurs when the new hardware or software is not compatible with the existing hardware, software, or operating system. It can cause the system to malfunction, crash, or fail to operate correctly. This can result in data loss, downtime, and additional costs to resolve the issue.
system malfunction due to compatibility issues can result in data loss, downtime, and additional costs to resolve the issue. Therefore, it’s essential to ensure that new hardware and software are compatible with the existing system and meet the required specifications.
Encapsulation
Encapsulation means having private variables;
Variables not directly accessible from outside the class; Methods and variables are all included in the class definition
Usability
Usability:
Usability means making the computer systems easy to use, matching them more
closely to user needs and requirements;
Describe two types of documentation that should be provided with the software package.
Technical documentation; Describes how to install software; Describes the hardware configuration needed;
User documentation; Describes various functions of the software; Helps users to learn how to use the software;
An international company is in the process of moving its Head Office from Europe to Asia.
(a) Identify two possible compatibility issues as a part of data migration.
Language differences/different character set;
Different conventions of representing various data/currencies, dates, etc;
Incompatible software/incompatible hardware;
Outline the function of an operating system in managing primary memory.
Outline the function of an operating system in managing primary memory.
A part of the OS (memory manager) assigns that block of memory to the program when a running program requests a block of memory;
When the program no longer needs the data in previously allocated memory blocks, they become available for reassignment;
Outline the need for higher level languages.
Outline the need for higher level languages.
High-level language(HLL) provides statements (for example, high level if(…), while(…) , etc) which are not dependent on the specific machine / and ability to create various data structures;
Which saves the programmer’s time;
Higher level languages are closer to human language;
So programmers find them easier to understand/work with than lower level languages;
Explain two benefits of using sub-procedures within a computer program.
Explain two benefits of using sub-procedures within a computer program.
Problem could be divided into smaller/easier parts;
Which means solving easier/smaller parts of the problem for one programmer; Or for a team of programmers, each programmer could work on different smaller parts;
Simpler testing;
Each part of the program could be separately tested;
By the programmer who created the code or someone else in the team of programmers;
Reusable code;
Sub-procedures already written/tested could be used in various programs;
Simpler maintenance and changes;
Identify three characteristics of a collection.
Collections are abstract data structures , does not have a set number of length, Collections have a set of methods that define operations performed on the elements/objects of that collection; (such as getnext, hasnext)
Construct in pseudocode an algorithm, using the access methods of a collection, which will iterate through the collection NUMBERS and count how many elements stored in the collection are in the interval [–1,1].
COUNTER = 0 NUMBERS.resetNext()
loop while NUMBERS.hasNext()
ELEMENT = NUMBERS.getNext()
if ELEMENT >= -1 and ELEMENT <= 1 then // abs(ELEMENT) <= 1
COUNTER = COUNTER + 1 end if
end loop output COUNTER
Difference between inherintee and aggregation:
While both can achieve the same result, Aggregation (composition) can lead to more robust and safer code;
whereas inheritance is a more flexible solution but prone to errors due to the behaviour of subclasses being changed;
Inheritance allows for code reuse / lowers maintenance cost; whereas aggregation does neither of the above;
Can have more than 1 aggregation; but only 1 superclass (in Java);
Ownership: Inheritance represents an is-a relationship between classes, where a subclass is a specialized form of its superclass. In contrast, aggregation represents a has-a relationship between objects, where an object contains another object as a part of it.
Object Lifetime: In inheritance, the subclass object is dependent on the superclass object and cannot exist independently. The lifetime of the subclass object is tied to the lifetime of the superclass object. In aggregation, the part object has its own lifetime and can exist independently of the whole object.
Reusability: Inheritance allows for code reuse by allowing the subclass to inherit properties and methods from the superclass. This makes it easier to create and maintain the code. Aggregation allows for objects to be composed together to form more complex objects, but does not provide the same level of code reuse as inheritance.