Professional Documents
Culture Documents
Software Construction
in Java for HSE Moscow
Tom Verhoeff
Eindhoven University of Technology
Department of Mathematics & Computer Science
Software Engineering & Technology Group
www.win.tue.nl/˜wstomv/edu/sc-hse
• In English
• Running: long-distance
• Introductory problem
• Motivation, background
• Study material
• What is a problem?
• Problem =
Difference between
• Programming language
• Programming tools
• Programming techniques
Course: 2 × 7 weeks
• Register
• Receive feedback
• Rational design
> 2+2
4
> import javax.swing.JFrame;
> JFrame jf = new JFrame(); // no window visible
> jf.show(); // now locate the window on your computer screen
> jf.getWidth()
128
> jf.setSize(640, 480);
> jf.setTitle("Hello, here I am!");
• One class
• No objects
"Hello"
"HSE!"
1 /**
2 * k kids together receive c candies.
3 * They wonder whether it is possible
4 * to divide all candies fairly.
5 *
6 * If this is possible, they also want to know
7 * how many candies each of them gets.
8 * This is a number q such that c == q * k .
9 *
10 * k, c, and q are non-negative integers, less than 10ˆ18.
11 *
• Put in your name, group, and the date, above cut line with --8<--
• This week
– no package statements
– no import statements
1 /**
2 * Consider the following dice game.
3 * Five players each roll once per round.
4 * Player 1 rolls a (fair) dodecahedron,
5 * having 12 faces with the numbers 1 through 12.
6 * The other players (2 through 5) roll two fair dice,
7 * each having 6 faces with the numbers 1 through 6.
8 * The player with the unique highest roll
9 * wins the round. If the highest roll is
10 * not unique, then there is no round winner.
11 *
1 /**
2 * Simulates r >= 0 rounds of the dice game and
3 * returns how often each player won.
4 * The return value is an array, where
5 * index 0 counts the number rounds without winner, and
6 * index i > 0 counts the number of rounds won by player i.
7 */
8 static public int[] simulate(int r) {
10 }
• codingbat.com
10 simple conventions
Layout:
Comments:
• Study Material
• DrJava, codingbat.com