This week is about logic in computer programing. 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).
Your tasks are to :
1- 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.
2- Writing assignments the nature of algorithm. 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,