×
Log in to StudySoup
Get Full Access to TTU - CS 2100 - Study Guide
Join StudySoup for FREE
Get Full Access to TTU - CS 2100 - Study Guide

Already have an account? Login here
×
Reset your password

TTU / Computer Science and Engineering / CS 2100 / this manipulator forces cout to print digits in fixed-point notation:

this manipulator forces cout to print digits in fixed-point notation:

this manipulator forces cout to print digits in fixed-point notation:

Description

School: Tennessee Tech University
Department: Computer Science and Engineering
Course: Intro/Prob Solving-Comp Prog
Professor: April crockett
Term: Fall 2016
Tags: programming and Studyguide
Cost: 50
Name: intro/prob-solving 2100 programming study guide test 1
Description: covers chapter 1 - 4. examples and definitions included, everything you need to know for this test in BROAD DETAIL.
Uploaded: 01/18/2017
3 Pages 87 Views 0 Unlocks
Reviews



o Cout object, given some code, what is the output?




o Null terminator sequence of characters that ends at the first '\0' o What does a comment start with and end with?




o What are the 3 primary activities in a program?



∙ 71 questions  ∙ Chapter 1 is 12 questions o Hardware- the physical component that a computer is made of o Memory address-to identify the location of a byte in memory o Variable- names of memory locations that hold a piece of information (must be We also discuss several other topics like when voltage-gated k+ channels open on the conductive segment of a neuron
If you want to learn more check out global issues exam 1
We also discuss several other topics like mul2010
If you want to learn more check out anthropology 201 iowa state
Don't forget about the age old question of ucsc econ major
Don't forget about the age old question of integrating functions using long division and completing the square
 defined) o Operators-symbols used to perform mathematical operations  Pay = rate * hours o Compilers- steps through the preprocessed source code, translating each code in the appropriate machine language instructions G++ lab.cpp -o lab o Algorithm  o Key words- only use them for their intended purpose (using, namespace, int) o Statement-variable definition o Preprocessor directive #include <iostream> 1st line o What are the 3 primary activities in a program?   Input  Process  output o Syntax error- wont compile o Logic error- it'll compile but won't work properly ∙ Chapter 2 26 questions o Scope-the part of the program in which the variable can be accessed. A variable  cannot be used before its defined o Null terminator sequence of characters that ends at the first '\0' o What does a comment start with and end with? // two forward slashes, /* */,  multiple comment block o Opening and closing curly braces (all main functions need curly braces)   { } -encloses a group of statements  () used in naming functions o Syntax for quotes for "strings"/'characters' o Numbering systems  o Cout object, given some code, what is the output? (includes number and strings) o What header file is used for cout and cin-iostream o Escape sequences:   \n-new line  \a- alert causes your computer to beep  \r- return cursors to beginning of line  \\-comment  \t-tab  \b- backs up ONE space o Be familiar with char data types and bool data type CHAR- used to hold  characters or very small integer values: char letter; letter = 'c'; BOOL in simply  true of false example : 12 > 5 is true o Example: BOOL  ∙ Bool boolValue;boolValue = true; Cout << boolValue << endl; boolValue = false Cout << boolValue << endl; o Math expressions, (given some code, what is the value)  o Integer division. cout << 13 / 5 ; //displays 2 if both operands are integers it'll  display integers o Cout << 13 / 5.0 // displays 2.6 if operand is floating point its display a float o Know syntax of defining/initializing variables- indicate what the variable is used  for, must be defined before used: float taxAmount (decimals) int quantity (whole  numbers). To initialize a variable means to assign it a value when it is defined o Syntax what marks the end of every programming statement -semicolon o Chapter 3 15 questions  Cin object, what does it do?- causes a program to wait until information is typed  into the keyboard and the enter key is pressed   Differences between cout uses << , cin uses >>   Cin.ignore();- clears and ignores the newline from the stream  Syntax of reading multiple values in one cin >> statement: cin >> length >>  width  Math expressions (given some code, what is the value or output)   Order of precedence (what comes first, 2nd, 3rd,)  ∙ 4 + 17 % 2 – 1:  ∙ 2 * 3 – 10 +5 (2 * 3 comes first) (-10 + 5 comes 2nd) (PEMDAS)  Combined assignment operator provide a short hand from these statements:  ∙ Sum = sum + 1 is equivalent to sum += 1; ∙ Y -= 2; is equivalent to y = y - 2 ∙ +=, *=, -=   Stream manipulators  ∙ Fixed- forces cout to print digits in fixed- point notation ∙ Setw(3)-prints 3 spaces --- ∙ Setprecision(3)-set the precision width of floating point numbers ∙ Showpoint- always print decimal for floats, causes trailing zeros to display ∙ Left- causes subsequent output to be printed to the left ∙ Right- causes output to be printed to the right o Chapter 4 18 questions  Relational operators-used to compare numbers to determine relative order  operations ∙ < ∙ > ∙ <= less than or equal to ∙ >= greater than or equal to ∙ == equal to∙ != NOT EQUAL  If/else statements, else if/ else statements, switch statements (give code, what is the value) (PAY VERY CLOSE ATTENTION!!)  Pay Very close attention-does the switch have a break for each case? If not..what happens? Without the break statement the program "falls through" all the  statements below the one matching the case expression  Pay attention to = v ==   Logical operators- what do they look like, what do they do (given code what is  the output)  ∙ &&- AND ∙ ||- OR ∙ !- NOT ∙ Examples : x = 12, y = 5, z = -4 ∙ (x > y ) && (y > z) TRUE ∙ (X > Y ) && (Z > Y) FALSE

Page Expired
5off
It looks like your free minutes have expired! Lucky for you we have all the content you need, just sign up here