C++ TUTORIAL : IMMERSION TRAINING MODULE #1

#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 'Prep': INTRODUCTION TO 'MAIN PROGRAM CODES'"<<"\n";

  cout<<"\n";

  cout<<"                                                          GOAL: LEARN AND EXPERIENCE C++ IN ACTUAL 'PRACTICE-ENVIRONMENT WEB-PAGE'"<<"\n";

  cout<<"\n";

  cout<<"\n";     

  cout<<"\n";

  cout<<"\n";

  string info;

  string info1;

  string info2;

  string info3;

  string back;

  string coda1;

  char c1 = '"';

  char c2 = '"';

  string coda2= "Hello";

  string coda3= "World";

  string coda4 = coda2+coda3;

  string code2;

  string code3;

  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<<"                                                #include<iostream>"<<"\n";

  cout<<"\n";

 

  cout<<"                                  Type it here: "; getline(cin,info);

  

 

   back='y'; 

    while(back!="n")

     {if(info=="#include<iostream>")

      {

  cout<<"\n";

  cout<<"                 GREAT, you got it!"<<"\n";

  

         back="n";}

     else {

  cout<<"                    TRY AGAIN... Type it here: "; getline(cin,info);

  cout<<"\n";

         back="y";}}

  cout<<"\n";

  cout<<"                As an informal tutorial, this is the very 'first password' we need to type-in to be able to enter into the C++ programming."<<"\n";

  cout<<"                We simply selected one of the  MAIN LIBRARIES of C++ Programming, for C++ has many different libraries to be able to 'identify'"<<"\n";

  cout<<"                the different programming codes, for different uses and purposes."<<"\n";




  cout<<"                NEXT, I want you to re-type this second 'password' code and then hit enter key..."<<"\n";

  cout<<"\n";

  cout<<"\n";

  cout<<"                                                using namespace std;"<<"\n";

  cout<<"\n";

 

  cout<<"                                  Type it here: ";getline (cin,info1);

  back='y'; 

    while(back!="n")

     {if(info1=="using namespace std;")

      {

  cout<<"\n";

  cout<<"                 GREAT, you got it!"<<"\n";

  

         back="n";}

     else {

  cout<<"                    TRY AGAIN... Type it here: "; getline(cin, info1); }}


  cout<<"                'std'- stands for standard, meaning, we'll be using standard codes common to C++ programming. 'Namespace' is simply, a term to identify the specific location"<<"\n";

  cout<<"                where we can find the codes for display command code, input command code, etc., in limited scope of application -  for us to practice our C++ skill."<<"\n";

  cout<<"                As you become professional programmer, this 'notation' become a 'no-no' and unacceptable. For now, as amateurs, this would be a 'valid excuse'"<<"\n";

 

  cout<<"                NEXT, I want you to re-type this third 'password' code and then hit enter key..."<<"\n";

 cout<<"\n";

  cout<<"\n";

  cout<<"                                                int main ()"<<"\n";

  cout<<"\n";

 

  cout<<"                                  Type it here: ";getline(cin, info2);

  back='y'; 

    while(back!="n")

     {if(info2=="int main ()")

      {

  cout<<"\n";

  cout<<"                 GREAT, you got it!"<<"\n";

  

         back="n";}

     else {

  cout<<"                    TRY AGAIN... Type it here: "; getline (cin, info2);}}


  cout<<"                     Just for curiosity but don't dwell to much on these: 'int'- means integer. 'main' - means the MAIN FUNCTION and () means 'void' or no specific detail for that 'main' program segment"<<"\n"; 

  cout<<"                     WELL, this is a little bit, difficult to comprehend. Technically speaking, 'int main ()' as a whole code, is a FUNCTION or a PROGRAM SEGMENT. Simply consider this, as a 'fence' where"<<"\n";

  cout<<"                     we can control all the animals inside it. We can feed them, separate one from another within the fence, etc. without any concern with the other fences outside that circle"<<"\n";

  cout<<"                     As we go become more skillful, we can include in our programming other program segments (or functions), but that will be a complex process."<<"\n";

  cout<<"                     FOR NOW, we can only do our activities inside this fence. Period."<<"\n"; 

  cout<<"\n";

  cout<<"                     The {   } (brackets), means to 'draw a line' of which codings are included in that MAIN FUNCTION."<<"\n";

  cout<<"                       Everything inside the open and close brackets are part of that function or program segment."<<"\n"; 

  cout<<"\n";

  cout<<"\n";

  cout<<"                   NEXT, I want you to re-type this last 'password' code and then hit enter key..."<<"\n";

  cout<<"\n";

  cout<<"\n";

  cout<<"                                                return 0;"<<"\n";

  cout<<"\n";

 

  cout<<"                                  Type it here: ";getline (cin, info3);

  back='y'; 

    while(back!="n")

     {if(info3=="return 0;")

      {

  cout<<"\n";

  cout<<"                 GREAT, you got it!"<<"\n";

  

         back="n";}

     else {

  cout<<"                    TRY AGAIN... Type it here: "; getline(cin, info3);}}

                           

  cout<<"                  The restore 'zero' is a prompt or command, to tell the computer to reset everything, after that certain C++ program was executed."<<"\n"; 

  cout<<"                  To EXECUTE a program, we have to RUN THE PROGRAM. After the program executed, returning to zero means to 'null' or empty the program segment (function)"<<"\n";

  cout<<"                  to avoid any 'glitche' in the system.Take note, the return zero is inside the brackets, meaning, it is the main function that we're resetting"<<"\n";     

 

  cout<<"                  TAKE NOTE: The complete structure 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 "<<"\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. Consider them as the set of passwords to enter into the C++ Programming"<<"\n";

  cout<<"                      When you HIT the 'RUN' the program button - all you can see in the USER DISPLAY PAGE will be a message..."<<"\n";

  cout<<"                      'Program finished with exit code 0,Press ENTER to exit console'. That's fine. It means, there's no error."<<"\n"; 

  cout<<"                      As A REMINDER, please 'memorize' them as they are VERY IMPORTANT in C++ programming."<<"\n"; 

  cout<<"\n";

  cout<<" // This is the 'main' C++ program structure. Source code: IMMERSION TRAINING MODULES - PREPARATORY MODULE by sirjon (MODULE #1)"<<"\n";

  cout<<"\n";

  cout<<"                 Next TOPIC ... MODULE #2 - "<<a<<"GETTING FAMILIAR WITH DISPLAY COMMAND CODE"<<a<<"\n";

  cout<<"\n";

  cout<<"                                                        THE END"<<"\n";

  return 0;

}


Comments

Popular posts from this blog

C++ SOURCE CODE FOR SIRJON'S "MICRO" TIC TAC TOE GAME FOR FUN!

ENTER CORRECT PASSWORD, THREE ATTEMPTS ONLY USING C++ WHILE-IF COMBINATION

C++ SOURCE CODE FOR SIRJON'S "MICRO" TIC TAC TOE GAME FOR LAPTOPS