Professional Documents
Culture Documents
Tut 2
Tut 2
I DO I understand
PROGRAMMING METHODOLOGY: Tutorial 2
Key to the activity done is to ASK QUESTIONS to your lecturer on any part of the tutorial that
you do not understand.
Type the code above in your C++ compiler as given. Save the file in your collection by giving it a specific
name. ANSWER the questions below:
#include <iostream>
int main() {
// prints the string enclosed in double quotes
std::cout << "This is C++ Programming";
return 0;
}
1) What was the C++ statement (command) you have to use to produce the output on the display?
>>
>>
>>
>>
#include <iostream>
using namespace std;
int main() {
int num1 = 70;
double num2 = 256.783;
char ch = 'A';
>>
>>
>>
>>
>>
6) Provide the coding so that the output of your code will be as shown below:
70
256.783 A
>>
7) Provide the coding so that the output of your code will be as shown below:
140
I HEAR I forget. I SEE I remember. I DO I understand
PROGRAMMING METHODOLOGY: Tutorial 2
256.783
A
>>
8) Provide the coding so that the output of your code will be as shown below:
140 A 256.783
>>