CS 110 Midterm Review - Summary Computer Science PDF

Title CS 110 Midterm Review - Summary Computer Science
Author Emily Devernichuk
Course Computer Science
Institution University of Regina
Pages 2
File Size 96 KB
File Type PDF
Total Downloads 34
Total Views 147

Summary

Full condensed and summarised class review for midterm preparation. Includes coding examples that will be relevant for the midterm. ...


Description

CS 110 – Midterm Study Notes 1. Basic Control Structures: a. Sequence: series of statements that execute one after another. b. Selection (branch): statement is used to determine which of the two statements to execute depending on certain conditions. c. Repetition (looping): statement is used to repeat statements while certain conditions are met. d. Subroutine: a collection of subprogram solves the original problem. 2. Flowchart Structures: a. Rounded Rectangle: start/end b. Parallelogram: input/output c. Rectangle: process d. Arrows: control flow e. Diamond: selection box/condition f. Box with Double Lines: subprogram/routine 3. Programming Life Cycle Phases: a. Problem-Solving: i. Analyze: the problem and specify what the solution must do. ii. Develop: general solution (algorithm) to solve the problem. iii. Verify: that the solution works. b. Implementation: i. Testing: running/executing the program. ii. Debugging: finding a problem within your algorithm to fix your program. c. Maintenance: i. Use/Modify/Rewrite 4. Boilerplate: #include Using namespace std; Void main () { //enter code } 5. Valid Identifiers: a. Must start with a letter or underscore and be followed by 0 or more characters. b. VALID CHARACTERS: (A-Z, a-z), digits (0-9), and underscores. 6. Standard Data Types: a. Integer (int): 0-4G unsigned, -2G-2G signed. b. Float: real numbers with a decimal point. c. Character (char): single alphanumerical character. 7. Error Types:

a. Syntax: program doesn’t compile (form). b. Run-Time: program compiles, but fails when running (execution). c. Logic: program compiles, runs, but gives wrong result (algorithm). 8. Manipulators () a. Fixed: forces decimal display rather than scientific display. b. Showpoint: forces display of a decimal point. c. Setw(n): determines the number of character positions in a field. d. Setprecision: determines the number of places displayed after the decimal point. 9. Substr Function: a. myString.substr(0, 4) returns ‘hell’ from ‘hello’ 10. Type Casting is an explicit conversion of type. 11. Type Conversion is an implicit conversion of type. 12. Functions: a. Stream.get () obtains the very next character from the input stream without skipping any leading whitespace characters (cin.get). b. Cin.ignore (howMany, whatChar) skips up to howMany characters or until whatChar has been read, whichever comes first. c. Getline (stream, string) stream is the input and string is the variable. Getline () does not skip whitespace. d. allows you to declare valid identifiers for your filestreams, such as myFile.get and myFile.ignore. 13. Input File Fail States: a. Invalid input data (often wrong type). b. Opening an input file that doesn’t exist. c. Opening an input file on a disk that is already full or is write-protected. 14. When using ‘find’ function, the count begins at 0, not 1.

15. 16. Binary / Decimal Conversions...


Similar Free PDFs