Example of an Exercise out of Lab Station 1:
To simulate the exercise uring the tour, please click on one of the pregenerated code windows, because evaluating free text is technically not possible inside the tour. In reality, the students have to actively write their code into the text area, and the code is analysed by the tutor.
The Peculiar Addition
Purpose of the exercise
Acquisition of knowledge, skills and insights about the following
central topics of interest:
- Introducion to basic elements of Java.
Task
Write a Java method adding two numbers and returning only the last digit
of the sum as result.
Background
The task has been kept very simple to introduce you to the lab station
"Java programming". You should make yourself familiar with the
main elements of the Java programming language.
Literature
- Course 1616 or 1618: Introduction to object oriented programming (in German: Einführung in die
objektorientierte Programmierung)
- "Java ist auch eine Insel".
- Official Homepage of Java.
Tools
You don't need any special tools to solve this task
Embedding of the Task within the Software
Environment
Your methods will be embedded in a Java-program, which will also check your
solution for correctness. This task is not linked with
other
VILAB
modules.
Characterisation of Solution
Please type a method that, being given two integer values, returns the
last digit of the sum of the two parameters.
Example: x=6, y=8 ==> result = 4
int addieren(int x, int y){