Lecture 2Simple ProgramsFall, 2015Computational Thinking
Computational Thinking 1 Lecture 2 Simple Programs Fall, 2015
Objectives. To be able to understand and writePython statements:? to output information to the screen,·assign values to variables: get numeric information entered, and perform a counted loopComputationalThinking1
Computational Thinking 2 Objectives • To be able to understand and write Python statements: • to output information to the screen, • assign values to variables, • get numeric information entered, and • perform a counted loop
Roadmap: The software development: Elements of program· Names·expressions: Output statements: Assignment statements· Definite loopComputational Thinking
Computational Thinking 3 Roadmap • The software development • Elements of program • Names • expressions • Output statements • Assignment statements • Definite loop
Software developmentAnalyze the problem· Determine specifications: Create a design (algorithm): Implement the design. Test/Debug the program? Maintain the programComputational Thinking
Computational Thinking 4 Software development • Analyze the problem • Determine specifications • Create a design (algorithm) • Implement the design • Test/Debug the program • Maintain the program
ExampleSusan刚刚来到中国,她什么都喜欢,唯独不喜欢中国的天气预报,因为她习惯华氏度(Fahrenheit),不习惯摄氏度(Celsius)她请求你的帮助,她告诉你,华氏和摄氏之间的转换是线性的,而且0摄氏度=32华氏度,100摄氏度=212华氏度。Computational Thinking
Computational Thinking 5 Example Susan刚刚来到中国,她什么都喜欢,唯独 不喜欢中国的天气预报,因为她习惯华氏度 (Fahrenheit),不习惯摄氏度(Celsius)。 她请求你的帮助,她告诉你,华氏和摄氏之 间的转换是线性的,而且0摄氏度=32华氏度, 100摄氏度=212华氏度