Lecture 4 Flashcards

1
Q

First 4 parts of code

A
  1. Header/comment
  2. # include<iostream></iostream>
  3. Using namespace std;
  4. int main()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Preprocessor command

A

A command that the computer looks for and reads first. Starts with # and given to the compiler. Preprocess commands are commands to the compiler, so they don’t need ;.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

3 preprocessor code examples

A

Include: brings in code with other files into the program
Define: can modify code
Ifdef: short for if defined, can choose lines of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Namespace

A

A set of functions or commands in another file. Typically are downloaded with C++. If not included at the being of the program, needs to be written with two colons before each command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Meaning of int main()

A

Int shows it returns an integer (0 for no error and a number for an error), main denotes the part of code to start with, and parentheses show it is a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Program requirements

A

The input, computations, and output needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Case test

A

Points of the program that need to be tested and the desired output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Important points to test

A

Edge/boundary/corner cases (at a boundary), special case (errors that might be input or different than expected), normal case.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly