CSE 130 Fall 2009 Home Work 1 Note: One copy of the text book (third edition) is on reserve in main library. 0. Take a look at the sample exam posted on the webpage. Expect some questions on arrays. 1. [3 points] State all important properties of an algorithm. 2. [2 points] What type of statement does all computational work for any programming language? 3. [3 points] Why do we need comments in a program? Describe two ways of writing comments in a C program and the difference between them. 4. [2 points] What is the default name of an executable file generated by gcc (the C compiler) on sparky? 5. [3 points] What is the difference between a logical error and a syntax error? 6. [3 points] Convert the switch statement example in class notes that deals with section-numbers, to an if-else chain. 7. [5 points] Write a program that reads in two integers m and n, both > 0, and calculates m raised to the power n in a variable called power. Print power at the end. (power = m*m*m* ... *m n times). 8. [6 points] Q5 on page 118 of the text. What is the output of the given program? 9. [8 points] Study program 7.3 given on page 103 of the text. Now do problem 6 on page 118. Remember you are going to print first 15 Fibonacci numbers without using an array. You need three variables. Print numbers as soon as they are generated. You need to initialize the first two numbers to 0 and 1 respectively. Do not forget to print these before the loop. 10. Expect something on Functions.