Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Release date: Thursday, 07.04.11 - Due date: Sunday, 17.04.11, 23:59
3 points |
---|
Explain the following terms in 1-3 sentences for each:
0-3,5 points: +0.5 per correct answer, -0,5 per incorrect |
---|
Question | Yes | No |
---|---|---|
All necessary classes must be available as source code for execution. | ||
Values of variables declared as “static” cannot be altered during runtime. | ||
The return type of overloaded methods has to be equal. | ||
Essential for a method signature are only it's name and the ordered list of parameter types. | ||
Interface may only declare public methods. | ||
“Object” and “class” can be used as synonyms. | ||
If o1 and o2 are both objects, then the following expressions are equivalent: o1 == o2 and o1.equals(o2). |
4 points |
---|
Implement a program that can calculate the following series. It should be possible to input an index of the series and the program should calculate the result for this index.
<code > n(0)= 1 n(1)= 0 n(2)= 2 n(3)=-1 n(4)= 3 n(5)=-2 n(6)= 4 .. </Code>
3 points |
---|
Explain the difference between overloading, overriding and shadowing. If necessary, provide a snippet illustrating your explanation.
3 points |
---|
Given the following Java code:
class C1 { static int s=1; void f1(){ System.out.println("C1::f1"); } void f2(){ System.out.println("C1::f2"); } } class C2 extends C1 { static int s=2; void f1(){ System.out.println("C2::f1"); } void f3(){ System.out.println("C2::f3"); } } public class Test { static public void main ( String[ ] args ) { C1 a=new C2(); C2 b=new C2(); Insert code here } }
Provide the output of the program above, with the below lines inserted at the “Insert code here” line. Compile and runtime-errors are also possible explanations.
0 points |
---|
The following task is optional and is meant for self-evaluation only, if you are curious to assess your own skills. This task is therefore not corrected or graded. The warmup is normally used as a programming warmup for a programming lab in our department.
You can find it here. Very fast students were able to solve this warmup in two hours. If it takes you up to two days, it would still be OK.