M3&M4 ComProg

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/99

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:33 PM on 10/4/23
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

100 Terms

1
New cards

C++ is an extension of

Extension of C

2
New cards

C++ supports _

Supports procedural, object-oriented and generic programming

3
New cards

C++ regarded as _

Coding language regarded as middle level language combines high and low-level language features

4
New cards

C++ developed by

Developed by Bjarne Stroustrup

5
New cards

When was C++ developed?

Developed in 1979 at Bell Labs in Murray Hill, New Jersey

6
New cards

Original name of C++

is C with Classes, later renamed C++ in 1983

7
New cards

Preprocessor directives are

they include the sharp symbol and include pre-written code that you can use to perform specific tasks, they tell the compiler to preprocess the source code before compiling

8
New cards

Comments are

they use the backslash symbol // or backslash with asterisk /* */ to leave notes in the codes that wont affect the code itself

9
New cards

main() function is

it is called the int main()

10
New cards

{ indicates

it is the start of the program

11
New cards

it is the output statement

called the cout or character output

12
New cards

} indicates

it is the end of the program

13
New cards

iostream inclusions

examples: cin, cout

14
New cards

math.h includes

examples: pow, sqrt

15
New cards

define directive

used to define symbolic names and constants

16
New cards

Block Comment

Their purpose is only to allow the programmer to insert notes or descriptions embedded within the source code

17
New cards

using namespace std;

All the elements of the standard C++ library are declared within what is called a namespace, the namespace with the name std (standard).

18
New cards

int main ()

The function named main is a special function in all C++ programs; it is the function called when the program is run. Semi colon is NOT required at the end.

19
New cards

Program statement

A statement is a simple or compound expression that can actually produce some effect.

20
New cards

compound statement,

also called a block, is a group of two or more C++ statements enclosed in braces

21
New cards

return 0;

This defines the exit status of the process or application. It terminates main( )function and causes it to return the value 0 to the calling process

22
New cards

keywords

are reserved words with special meaning in C++.

23
New cards

identifier

a name used to identify a variable, function, class, module, or any other user-defined item

24
New cards

variable

known as user-defined identifier. It is a data storage location that has a value, which can change during program execution.

25
New cards

data types

used to tell the variables the type of data it can store

26
New cards

Datatype Modifiers are used

modify the length of data that a particular data type can hold. ex, signed unsigned short long

27
New cards

int is

integer; requires 4 bytes of memory

28
New cards

char is

character, req 1 byte of memory

29
New cards

bool is

boolean, used for storing boolean or logical values. A boolean variable can store either true or false

30
New cards

float is

floating pont used for storing single precision floating point values or decimal values req 4 bytes of memory

31
New cards

double is

double floating point used for storing double precision floating point values or decimal values requires 8 bytes of memory

32
New cards

void

represents a valueless entity or without any value. It is used for those function which does not returns a value

33
New cards

wchar_t is

Wide Character, also a character data type but has a size greater than normal 8 bit datatype. generally 2 or 4 bytes long

34
New cards

global

Outside of all functions, including the main() function

35
New cards

local

Inside the function. Variables in this way are called _ variables and may be used only by statements that are also in the same function

36
New cards

constant

expression that has a fixed value.

37
New cards

constant must be enclosed between _

a character must be enclosed between single quotes

38
New cards

string constant is enclosed by _

it is enclosed by double quotation

39
New cards

Integer numbers

are specified as numerical (whole number) constants without fractional components. No need to write quotes (“) to express a numerical constant.

40
New cards

Operators

symbols that tell the compiler to perform specific mathematical or logical manipulations.

41
New cards

Assignment Operator

gives value to a variable (a single equal sign)

42
New cards

Arithmetic operator

perform addition, subtraction, multiplication, division, exponentiation, and modulus operations.

43
New cards

operator precedence

specifies the order of operations in expressions that contain more than one operator (remember PEMDAS; parentheses, exponents, multiplication, division, addition and subtraction)

44
New cards

compound operators

consist of a binary operator and the simple assignment operator. They perform the operation of the binary operator on both operands and store the result of that operation into the left operand, which must be a modifiable lvalue.

45
New cards

increment operator

is ++, adds 1 to its operand

46
New cards

decrement operator

is —, subtracts 1 from its operand

47
New cards

relational operators

operators that allow the comparison of two or more numerical values, yielding a result based on whatever the comparison is true(1) or false(0).

48
New cards

logical operators

used to combine two or more conditions or to complement the evaluation of the original condition in consideration. The result of the operation of a logical operator is a boolean value either true or false.

49
New cards

bitwise operators

characters that represent actions (bitwise operations) to be performed on single bits, will be turned to binary

50
New cards

& is

bitwise AND

51
New cards

| is

bitwise inclusive OR

52
New cards

^ is

Bitwise exclusive OR

53
New cards

~ is

Unary complement NOT

54
New cards

« is

Shift bits left SHL

55
New cards

» is

Shift bits right SHR

56
New cards

Conditional operators

also called as ternary operators, used to evaluate a condition that's applied to one or two boolean expressions

57
New cards

elements of c++ are

  • keywords

  • character set

  • data types

  • identifiers

  • operators

58
New cards

primitive data types

built-in/pre-defined data types and can be used directly by the user to declare variables and can be used to present data as characters, integers, floating-point numbers and boolean values

59
New cards

constructor initialization

enclosing the initial value between parentheses

60
New cards

3 places where variables can be stored

  • Outside the int main() called global

  • inside the function called local

  • in the declaration of a formal parameter of a function

61
New cards

input and output (I/O) operators are used

take input and display output

62
New cards

extraction (»)

operator used for taking the input or get from operator

63
New cards

insertion («)

operator used for displaying the output, put to operator

64
New cards

iostream

standard input and output stream objects are declared

65
New cards

screen

standard output by default, cout

66
New cards

keyboard

standard input by default, cin

67
New cards

getline()

  • a standard library function in C++ and is used to read a string or a line from input stream.

  • takes the stream (cin) as first argument, and the string variable as second.

68
New cards

Type Conversion

process of converting one predefined type into another.

69
New cards

Implicit

automatic type conversion. performed by the compiler without programmer's intervention.

70
New cards

type casting

The explicit conversion of an operand to a specific type

71
New cards
72
New cards
73
New cards
74
New cards
75
New cards
76
New cards
77
New cards
78
New cards
79
New cards
80
New cards
81
New cards
82
New cards
83
New cards
84
New cards
85
New cards
86
New cards
87
New cards
88
New cards
89
New cards
90
New cards
91
New cards
92
New cards
93
New cards
94
New cards
95
New cards
96
New cards
97
New cards
98
New cards
99
New cards
100
New cards