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.

Tomorrow, December 7, is the International Civil Aviation Day.

1. Describe at least two events from the history of computing, and how these events affected the field of computing.

2. The total weight of a plane is equal to the weight of a plane itself plus the overall weight of the passengers -- computed as the average passenger weight times the number of passengers. Write a method that takes, as input, the weight of the plane itself, the number of passengers, and the average weight of the passengers, and returns the total weight of the plane. Trace this method on the example of a small plane that weighs 200 kg and has 2 passengers of average weight 70 kg.

- to trace a method, first write a line of code (to be placed in the method
*main*) that call 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 weight of a plane.

4. Dr. Kreinovich was originally planning to fly to a conference in Houston to present his joint paper with Dr. Longpre, but it turns out that he cannot go, so Dr. Longpre will fly instead. It is therefore necessary to change a ticket. 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. It is recommended that a passenger who is not checking in luggage arrives at the airport:

- 1 hour before a domestic flight and
- 2 hours before an international flight;

- by using
*if*statements, and - by using two ?: operators.

7. The passenger list for a flight is contained in a file:

- the first line of this file contains the name of the first passenger,
- the second line contains the name of the second passenger,
- etc.

- the name of the first passenger is placed in the first element
*names[0]*of the array, - the name of the second passenger is placed in the second element
*names[1]*of the array, - etc.

8. Write a method that takes, as the input, the array of passenger weights, and returns the average weight of the passengers. Assume that there are no empty spots in the array. Assuming that a weight can be from 1 kg to 150 kg, and the number of passengers can be from 1 to 10, what are the reasonable test cases for this method? Give specific examples of the corresponding test arrays.

9. Use the algorithms that we learned in class to translate 12 and 7 into binary, add these numbers in binary, and translate the sum 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 12.0 and 7.0, what will be the result?

10. Is it ethical to copy your lab assignments from someone else or from the web and present it as your own? Is it ethical, instead of buying a copyrighted textbook, to download it, for free, from a webpage where it is illegally posted? For each of these two cases, present:

- at least two arguments that students give in favor of copying, and
- at least two arguments why, in this case, copying is harmful (more arguments for extra credit).