Each problem is worth (approximately) the same number of points. Extra credit for a problem will be given only if the problem itself is solved correctly. If you use extra sheets of paper, place your name on each sheet.

On this day, May 11, 1997, a chess-playing computer Deep Blue defeated Garry Kasparov, the world chess champion.

1. Describe the contribution of computing pioneers Charles Babbage and Ada Lovelace to
the field of computing.
*For extra credit:* Describe one more event from the history of computing, and how this event affected the field of computing.

2. In a chess championship, a win brings 1 point, a tie brings 0.5 points, and a loss brings 0 points. Write a method that takes, as input, the numbers of wins, ties, and losses, and returns the total number of points earned by the player. Trace this method on the example when a player had 4 wins, 3 ties, and 5 losses; your method should return 4 * 1 + 3 * 0.5 + 5 * 0 = 5.5 points.

- to trace a method, first write a line of code (to be placed in the method
*main*) that calls this method; - please notice that in the method, we are not asking you to print anything or read anything from the screen or from a file.

3. (related to Problem 2) Define a class

- a constructor method,
- methods for returning and changing the field values, and
- a method for computing the total number of points.

4. After the defeat, Deep Blue became the world's chess champion. It was therefore necessary to change the wording of the chess federation webpage. Write a piece of code that, given a string

5. (related to Problem 4). Write a method that swaps the values of two globally defined string variables

6. In one of chess tournaments, it is possible to gain up to 6 points. If you gain 6 points, you are the champion. If you earn 4 or 5 points, you automatically become a chess master. If you earn 2 or 3 points, your status does not change. If you earn 0 or 1 points, you are disqualified from future tournaments of this level. Assume that the number of points is stored in an integer variable

- by using
*if*statements, and - by using
*switch*statements.

7. The list of chess players who participated in a tournament is contained in a file:

- the first line of this file contains the name of the first player,
- the second line of this file contains the number of points earned by the first player,
- the third line of this file contains the name of the first player,
- the fourth line of this file contains the number of points earned by the second player,
- etc.

- the name of the first player is placed in the first element
*names[0]*of the array, and this player's number of points is placed into the element*points[0]*; - the name of the second player is placed in the second element
*names[1]*of the array, and this player's number of points is placed into the element*points[1]*; - etc.

8. Write a method that takes, as the input, the array

9. Use the algorithms that we learned in class to translate 5 and 11 into binary, add and multiply these numbers in binary, and translate the results back into decimal (to check the correctness of the result). Suppose that a computer has only one decimal significant digit, and it uses round-off; if you ask this computer to add 5.0 and 11.0, what will be the result?

10. People who hack into computers claim that they are doing a useful job for the community by discovering the defects of the existing computer security systems. Is it ethical? Explain your answer. Give two other examples of unethical computer-related behavior (more for extra credit); for each example, explain how people justify their behavior and why it is harmful to these people and/or to others.