A standard input stream
Used to store multiple values in a single variable, instead of declaring separate variables for each value.
It can execute a block of code as long as a specified condition is reached.
Loops
Use ___ to specify a block of code to be executed, if a specified condition is true
if
•A COMPUTATIONAL DEVICE WHICH IS USED TO PROCESS THE DATA UNDER THE CONTROL OF A COMPUTER PROGRAM.
input function for strings
getline
Write an array that inputs 5 instances of the myName variable
string myName[5];
•The loop that loops through a block of code as long as a specified condition is true.
While Loops
Use ____ to specify a new condition to test, if the first condition is false
else if
Sequence of Instruction along with data.
Program
an alternate to \n
endl
int x[4] = {1,2,3,4};
•The loop that is a variant of the while loop. This loop will execute the code block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true.
do/while loop
Use the ____ statement to select one of many code blocks to be executed.
switch
•One of the first programming languages that is introduced to the public
FORTRAN
Give at least one feature of I/O in C++.
1. type safe
2. based on streams of bytes and are device independent.
int main(){
int num[3] = {20,30,50};
cout<<num[3];
return 0;}
NOTHING/ERROR
num[0] = 20;
num[1] = 30;
num[2] = 50;
Write the syntax of the while loop.
while (condition) {
// code block to be executed
}
write the syntax in writing the if else statements
if (condition) {
// block of code to be executed if the condition is true
} else {
// block of code to be executed if the condition is false
}
Differentiate Computer Programming and Web Programming
Computer programming are used to operate computers while Web programming are used to design websites and pages.
Differentiate I/O in C and C++
•C doesn’t have built in input/output facilities. Instead, it left the I/O to the compiler as external library functions such as printf/scanf in stdio.h library.
•Likewise, C++ continues this approach and formalizes IO in iostream and fstream libraries.
Explain how to access the Elements on an array.
■You access an array element by referring to the index number inside square brackets [].
■Array indexes start with 0: [0] is the first element. [1] is the second element, etc.
Write the syntax of the For Loop
for (statement 1; statement 2; statement 3) {
// code block to be executed
}
Write the syntax for switch statements.
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
4 Things to Know Before you Code in C++
1.C++ cannot be learnt in a day
2.Learning C++ can be hard
3.No, you don’t need to learn C before C++
4.Don’t wait for the next C++ release