Review C++ Programming 1

Ace your homework & exams now with Quizwiz!

!=

not equal to

setw(n)

used to output a value in specific # of columns

What is "if else"?

To run a test and then determine an output. if(test) {there is a command in here }else{there is a command in here} you can have as many commands as you want.

How do we get the program to move to a new line?

Use << endl; or you can use /n inside the ""; or you can do /n/n for a blank line.

What is the if statement?

A basic way that computers can make decision.

What is a variable?

A placeholder there are many types

What is "int"?

A variable integer.

What is x += 10;

Assignment and increment operators. Can also be used -=, *=, and /= it is a shortcut that is used only when x is defined previously.

Are blank lines and tabs necessary?

Blank lines are not necessary but make the program easier to read. The same goes for tabs.

What is C++ and enhancement to?

C++ is an enhancement to C.

What does "endl" mean?

Goto the end of the line. you can also use \n inside the ""

What is a loop?

Tells the program to run it over and over again.

==

equal to

<

less than

What operations can you use in C++?

+,-, *, / if you want the remainder you need to use % modulus operator

statement

A C++ "sentence" like cout << "Game Over!" << endl; that ends with a semicolon (;);

What is C++?

C++ was created in the late 70's by a Danish programmer Bjorn.

What does each function line end with?

Each function line ends with a ";"

What does each statement end with?

It ends with a semicolon;

What is each line called?

It is called a statement

What does "return 0" mean?

It is part of the main function and it is set to zero. It will give the output unless there is an error.

What does "cout" mean?

Output stream object used to write characters on the screen.

What does STL Stand for?

STL stands for the standard template library.

What is "using namespace std"?

Tells the program that you are going to be using the standard (std) library.

What does << mean?

The stream insertion operator. Used with cout.

What is a while loop?

Use the term "while (variable)" you can make a definition and then have a number added to it so that at some point the statement will be false.

What is "cin"?

When you want to take information in from the computer. You use >> in front to take in information.

What can you do with variables?

You can define them to equal relationships of each other. a= 5, b=21, and sum = a + b then cout the sum variable you can also assign a variable immediately or later it is called "declaring the variable".

How do you tell the program where to start?

You use the function "main". in C++ it is "int main()"

double

a data type for floating point numbers (numbers with a fractional part).

float

a data type for floating point numbers that typically has less storage space than a double.

int

a data type for integers (numbers with no fractional part).

cin

a filestream variable that represents the default input source

cout

a filestream variable that represents the default output device

What is #include <iostream>?

a header file #include <iostream> is a preprocess directive. Telling the program that there is a file that we are going to use later.

char

data type for a single character

>

greater than

>=

greater than or equal to

iomanip

header file that contains commonly used manipulators used to format output

What types of programming is C++ used for?

it is used for object oriented, funtional, procedural, and generic programming.

<=

less than or equal to

endl (same as '\n')

manipulator that causes the insertion point (cursor) to move to the beginning of the next line

endl

sending this object to the standard output is like pressing the Enter key in the console window.

main

the function that is the starting point of a C++ program

#include <iostream> using namespace std; int main() { return 0; }

the parts required in every C++ program

>>

the stream extraction operator

<<

the stream insertion operator

return statement

A statement that ends a function.

{}

Beginning and the end of a function

What does "x++" mean?

x+1


Related study sets

Unofficial SAT Word Dictionary (A~I)

View Set

Bio 189: Chapter 14 - Speciation & Extinction

View Set

Chapter 49. Nursing Care of Patients With Cerebrovascular Disorders

View Set

LS1 Week 5 Chapter 33 Management o Pt With Nonmalignant Hematologic Disorders

View Set

Subject-Verb Agreement (Is vs Are)

View Set

Ch 40 and 41 Nutrition and obesity

View Set