C++ TUTORIAL : IMMERSION TRAINING MODULE #2
#include<iostream>
using namespace std;
int main ()
{
cout<<"\n";
cout<<"\n";
//THIS PART OF THIS WEB PAGE IS WHAT I CALL - "PROGRAMMER'S PAGE". In here where you paste the source code...
cout<<" // Take Note:THIS PART OF THIS WEB PAGE IS WHAT I CALL -'USER'S DISPLAY PAGE', where you WILL SEE your intended program coding"<<"\n";
cout<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" TITLE: EASY C++ TUTORIAL FOR FIRST TIME HOBBYISTS"<<"\n";
cout<<" (IMMERSION TRAINNG MODULES)"<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" MODULE 1A: INTRODUCTION TO 'EXECUTIONAL PROGRAM CODES'"<<"\n";
cout<<"\n";
cout<<" GOAL: LEARN THE DIFFERENCE BETWEEN -"<<"\n";
cout<<" 1.DISPLAY COMMAND CODE (C++)"<<"\n";
cout<<" 2. INPUT COMMAND CODE (C++)"<<"\n";
cout<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" SUB-TOPIC: MODULE #1 - GETTING FAMILIAR WITH THE DISPLAY COMMAND CODE"<<"\n";
cout<<"\n";
string info;
string back;
string coda1;
string coda2;
string ans;
char a = '"';
char a1 = ';';
cout<<" As initial activity, I want you to re-type this code and then hit enter key..."<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" cout<<"<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" Type it here: ";cin>>info;
cout<<"\n";
cout<<"\n";
back='y';
while(back!="n")
{if(info=="cout<<")
{cout<<"\n";
cout<<" Great, you got it!";
back="n";}
else {
cout<<" TRY AGAIN... Type it here : "; cin>>info;
back="y";}}
cout<<"\n";
cout<<"\n";
cout<<" Everytime you use this 'display command'... an intended message will be seen on the USER'S DISPLAY PAGE."<<"\n";
cout<<"\n";
cout<<" The complete 'code combination' is this..."<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" cout<<"<<a<<" "<<a<<a1<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" Each part is important: "<<"\n";
cout<<"\n";
cout<<" 1) cout<< - the DISPLAY COMMAND"<<"\n";
cout<<" 2) "<<a<<" "<<a<<" - DISPLAY MARKERS (double quotation marks),the message IN-BETWEEN those two quotation marks"<<"\n";
cout<<" is what we will only 'SEE' in the USER's DISPLAY PAGE when we run the program "<<"\n";
cout<<" 3) ; - CODE SEPARATOR. This is a very important part of any C++ code, to be able to separate one code to another"<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" Here is an example:"<<"\n";
cout<<"\n";
cout<<" cout<<"<<a<<"Hello World "<<a<<a1<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" 1) What is the Display command? "; cin>>coda1;
back='y';
while(back!="n")
{if(coda1=="cout<<")
{back="n";}
else {
cout<<"\n";
cout<<" TRY AGAIN... Type it here : "; cin>>coda1;
cout<<"\n";
back="y";}}
cout<<" 2) What is the first display marker? : "; cin>>a1;
back='y';
while(back!="n")
{if(a=='"')
{back="n";}
else {
cout<<" TRY AGAIN... Type it here : "; cin>>a1;
back="y";}}
cout<<" 3) What is the Message to be displayed?"<<"\n";
cout<<" a. Hell World"<<"\n";
cout<<" b. Hello World"<<"\n";
cout<<" c. Hey World"<<"\n";
cout<<"\n";
cout<<" (CHOOSE the Correct Letter): "; cin>>coda2;
cout<<"\n";
while(back!="n")
{if(coda2=="b")
{back="n";}
else {
cout<<" TRY AGAIN... Type it here : "; cin>>coda2;
back="y";}}
cout<<" 4) What is the second display marker? "; cin>>a;
back='y';
while(back!="n")
{if(a=='"')
{back="n";}
else {
cout<<"\n";
cout<<" TRY AGAIN... Type it here : "; cin>>a;
back="y";}}
cout<<" 5) What is the code separator? "; cin>>a1;
back='y';
while(back!="n")
{if(a1==';')
{back="n";}
else {
cout<<"\n";
cout<<" TRY AGAIN... Type it here : "; cin>>a1;
back="y";}}
cout<<"\n";
cout<<" Great, you got it!"<<"\n";
cout<<"\n";
cout<<" SUMMARY:"<<"\n";
cout<<"\n";
cout<<" In C++ Programming, there are many 'specific assigned codes' to do certain tasks and functions."<<"\n";
cout<<" The DISPLAY COMMAND CODE - cout<<"<<a<<" "<<a<<a1<<" is one of them and one of the most commonly used C++ codes."<<"\n";
cout<<"\n";
cout<<" TAKE NOTE: The complete stucture for this C++ program exercise is:"<<"\n";
cout<<"\n";
cout<<" 1 #include<iostream>"<<"\n";
cout<<" 2 using namespace std;"<<"\n";
cout<<" 3 int main ()"<<"\n";
cout<<" 4 {"<<"\n";
cout<<" 5 "<<"\n";
cout<<" 6 cout<<"<<a<<"Hello World"<<a<<"\n";
cout<<" 7 "<<"\n";
cout<<" 8 return 0;"<<"\n";
cout<<" 9 }"<<"\n";
cout<<"\n";
cout<<" REMEMBER: "<<"\n";
cout<<"\n";
cout<<" The above set of C++ program codes are placed in the Programmer's Page. But only the message,'Hello World' will appear in the"<<"\n";
cout<<" User's Display Page when you HIT the 'RUN' the program button. Only the 'contents' inside the Display Markers are seen by the User."<<"\n";
cout<<" Therefore, without using the DISPLAY COMMAND CODE, anything 'written' on the Programmer's Page is HIDDEN TO ANY USER."<<"\n";
cout<<"\n";
cout<<" // to understand the 'main' C++ program structure, REFER to source code: IMMERSION TRAINING MODULES - PREPARATORY MODULE by sirjon"<<"\n";
cout<<" SEE LINK in the Description Section Below..."<<"\n";
cout<<"\n";
cout<<" Next TOPIC ... MODULE #3 - "<<a<<"GETTING FAMILIAR WITH INPUT COMMAND CODE"<<a<<"\n";
cout<<"\n";
cout<<" THE END"<<"\n";
return 0;
}
Comments
Post a Comment