CS 110 Class Notes PDF

Title CS 110 Class Notes
Author Emily Devernichuk
Course Computer Science
Institution University of Regina
Pages 14
File Size 127.6 KB
File Type PDF
Total Downloads 78
Total Views 167

Summary

All lecture notes for CS 110. Includes examples of coding and outcomes, as well as midterm and final information and specific questions. ...


Description

CS 110 – 01 05 1. Grading a. Labs (10%) – (5% Lab) / (5% Lab Test) b. Class Assignments (18%) – 6 @ (3%) c. Quizzes (12%) – 4 @ (3%) d. Midterm (20%) e. Final (40%) 2. Reminders a. Must pass final to pass the course. b. Must bring electronic device for all quizzes/exams. c. Class end on April 12th. d. Always use PDF and .cpp for online submissions. e. Install IDE (x-code) to practice. f. x-code for class and v-studio for lab. 3. Assignments a. January 20 b. February 3, 17 c. March 10, 24 d. April 7 4. Quizzes a. January 26 b. February 9 c. March 16, 30 5. Midterm a. March 2 6. Final a. April 19 (7:00PM) CS 110 – 01 10 1. Basic Control Structures a. Sequence b. Selection (branch) [IF > THEN > OTHERWISE] c. Looping (repetition) [WHILE > DO] d. Subroutine 2. Interaction a. Input: prompt user/collect info b. Output: display info to user/send info 3. Flow Chart Structure/Guideline a. Rounded Rectangle – start/end

b. Parallelogram – input/output c. Rectangle – selection d. New Symbol – based on condition in box, one of two branches is taken (yes or no question) 4. Symbols a. (green) // - comment specifically for the code writer. b. % - mod (remainder) – divide and give remainder. c. ! – NOT – not equal to. 5. Programming Life Cycle Phases a. Problem Solving: Analyze, Develop, Verify b. Implementation: Code, Documentation, Compiler c. Maintenance: Use, Modify, Rewrite 6. Problem Solving Techniques a. Ask questions. b. Solve by analogy. c. Look for familiar things. d. Use means-ends analysis. e. Divide and conquer. f. Building-block approach. g. Merge solutions. h. Overcome mental block.

CS 110 – 01 12  Representing integers in Binary o Integers as powers of 10  328 = 300 + 20 + 8 o Binary as a sum of powers of 2  310 = 2 + 1 = 112  510 = 4 + 1 = 1012  Because there is no 2 in the original number. o 1 0 0 0 0 = 16 o 29 = 1 1 1 0 1 o Odd if 1 at end. Even if 0 at end.  Programming Language: language with strict grammar rules, symbols, and special words used to construct a computer program.  Machine Language: runs only on a specific type of computer. o Made up of binary coded instructions (strings 1s and 0s).  High Level Languages: can be used on different types of computers. o Standardized by ISO/ANSI

o Most allow extensions, frameworks, and libraries to make common things easy.  Three C++ Program Stages o Source (myprog.cpp): written in C++ o Object (myprog.obj): Machine Language o Executable (myprog.):  Computing Profession Ethics o Copy software only with permission from the copyright holder. o Give credit to another programmer by name whenever using his/her code. o Use computer resources only with permission. o Guard the privacy of confidential data. o Use software engineering principles to develop software free from errors.  Summary: o Programming Life Cycle Phases  Problem-Solving, Implementation, Maintenance o Problem-Solving Information  Input, Constants, Computed Values, Results o Programming Structures:  Sequence, Selection, Loop, Subprogram o Flowcharts  Terminals, 1/0, Process, Decision, Subroutine NEXT SECTION  Syntax/Output: how to print something to the screen. o C o u t > x >> y; 7. > a. Cin >> age; i. Information moves from the stream to the variable. b. Cout > message; Cout = != == ii. **= is an assignment and == is a comparison 1. (y = 6 and x = 4) 2. Y = x + 3 resolves to 7 3. Y == x + 2 resolves to true c. Operands can be anything (should be same type) and result is type bool (true or false). 4. ‘if’ statements a. The selection control structure is represented using if statements If () {

} Play(); GoOutside(); is called only if isSunny evaluates to true Play(); is always called. 5. If . . . else If(mark>50) Cout...


Similar Free PDFs