C++ basics Flashcards Preview

Intermediate Programming > C++ basics > Flashcards

Flashcards in C++ basics Deck (18)
Loading flashcards...
1

to be able to interact with the users keyboard inputs and be able to put text onto the screen what line of code is neede

#include
using namespace std;

2

output text to screen line

cout << "text";

3

to output new line in text

\n

4

to output a tab character in text

\tab

5

to start a sing line comment

//

6

to start a multiple line comment

/*

7

floating point representation of a number vs int representation

5 vs 5.0

8

do #include lines end with semi colon

no

9

decalre a variable called celcius of type int

int celsius;

10

assign a declared variable called Celsius the number 5

celcius = 5;

11

send three outputs to the screen in one line
these are:
int fahr
tab char
int celcius

cout << fahr << '\t' << celcius;

12

get input from the user. The input will be assigned to the already defined int i

cin >> i;

13

get input from the user. There will be 2 inputs. They will be assigned to the already defined ints i and j

How can it separate this input

cin >> i >> j;

white space characters tells it when to move onto next int

14

line to include string class

#include

15

line to include file reading

#include

16

create a file stream object called myinput

and then connect the file called file_of_words to the file stream onject

ifstream myinput;

my input.open("file_of_words");

17

in order to create a fucntion you must first

define it

18

to include an external function from another file in your program what line of code must be used

eg power function which is of type int and takes two ints of base and exponent

extern int power(int base, int exponent);

in the top of program