**Description Week 3 – Programming Logic**

This week is about logic in computer programming. Ultimately, everything that a computer does is based on Boolean Logic — a system of binary mathematics based on the values true and false — as first defined by George Boole in his book ** An Investigation of the Laws of Thought on Which are Founded the Mathematical Theories of Logic and Probabilities, **published in 1854. Each bit can be thought of as a true or false value manipulated by computer systems according to the laws described by Boole.

On a larger scale, we deal with Boolean logic in true or false conditions that determine which parts of an algorithm are executed. In most computer programming languages, including Python, *if* statements and *if … else …* statements are used for this when the algorithm divides into different branches.

This week you will read about *if* statements and variations of *if* statements in Python; Boolean logic; and the nature of algorithms, which lie at the heart of all computing and computer programming.

Remember, this is an introductory Computer Science course, not just a course in Python and Java programming. Some of the material in the section that you will read about algorithms is fundamentally important in Computer Science (and in modern mathematics as, well).

**Description Week 3 – Programming Logic**

Your tasks are to :

- Read
*Lesson 3.2*,about the nature of algorithms, in chapter 3 from*An Introduction to Computer Science with Java, Python and C++*and answer the five checkpoint questions on page 24 at the end of the lesson.*Lessons 3.1*and*3.3*,and*Lab 3A,*are not required, but they will help you to better understand Boolean logic, branching, and*if*statements in Python.

You should submit a word document with your answers to the five questions.

- Read through
*Lab 3B starting on page 36*in Chapter 3 and make sure that you understand it. It is a good example showing a design first approach to writing I-P-O software for math problems that involve branching. - Complete Exercise 10 at the end of the chapter as a programming assignment. This involves the use of the Hypotenuse function to determine a point’s distance from the origin in a Cartesian coordinate system, and branching to determine which quadrant a point is in.

You should submit your Word document with the answers to the questions at the end of Lesson 3.2, and the source code file for your Python project.

###
**Programming Logic **Assignments:

1- Read *Lesson 3.2* about the nature of algorithms in chapter 3 from *An Introduction to Computer Science with Java, Python and C++* and answer the five checkpoint questions at the end of the section. *Lessons 3.1* and *3.3* and *Lab 3 A* are not required, but they will help you to better understand Boolean logic, branching, and if statements in Python,

You should submit a word document with your answers to the five questions.

2- Complete Exercise 10 at the end of the chapter as a programming assignment. This involves the use of the *hypotenuse function* to determine a point’s distance from the origin in a Cartesian coordinate system, and branching to determine which quadrant a point is in.

Note: If a point is on the x-axis or the y-axis, which coordinate is it in? The specifications answer this question. Read the conditions in the problem carefully and make sure the logic in your software matches what it says.

You should submit the source code file for your finished Python project.

Last Updated on