C++ TUTORIAL : IMMERSION TRAINING MODULE #3
#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 the RESULT of 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 1C: 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 #3 - GETTING FAMILIAR WITH THE MEMORY CONTAINER"<<"\n";
cout<<"\n";
string info;
string back;
string coda;
string coda1;
char a = '"';
char a1;
cout<<" As initial activity, I want you to re-type the following codes and then hit enter key..."<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" DataType |NAME|;"<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" Type it here: ";getline(cin, info);
cout<<"\n";
cout<<"\n";
back="y";
while(back!="n")
{if(info=="DataType |NAME|;")
{cout<<"\n";
cout<<" GREAT, you got it!";
back="n";}
else {
cout<<" TRY AGAIN... Type it here : ";getline(cin, info);
back="y";}}
cout<<"\n";
cout<<"\n";
cout<<" Everytime you 'create' this complete code for a 'Memory Container'... a 'very small size' of a portion of the computer's memory storage"<<"\n";
cout<<" is being allocated and given a 'NAME ADDRESS'. It can contain, either a 'true' number, letter or letters of the alphabet, special character/s,"<<"\n";
cout<<" or combination of all"<<"\n";
cout<<"\n";
cout<<" The complete 'code combination'for this is..."<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" Examples: int Number; "<<"\n";
cout<<" char Special_Char;"<<"\n";
cout<<" string Word;"<<"\n";
cout<<" Each part is important: "<<"\n";
cout<<"\n";
cout<<" 1) int, char, string - DATA TYPE"<<"\n";
cout<<" 2) |NAME| = Number, Special_Char, Word - a UNIQUE LABEL (NAME), of the Memory Container where the 'input data'(or message) is going to be stored "<<"\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<<" string info; "<<"\n";
cout<<"\n";
cout<<"\n";
cout<<" 1) What is the 'type of Data' to be stored (DATATYPE)? "; getline(cin, coda);
cout<<"\n";
back="y";
while(back!="n")
{if(coda=="string")
{back="n";}
else {
cout<<"\n";
cout<<" TRY AGAIN... Type it here : "; cin>>coda;
cout<<"\n";
back="y";}}
cout<<" 2) What is the Memory Container's Name? "; cin>>coda1;
cout<<"\n";
back= "y";
while(back!="n")
{if(coda1=="info")
{back="n";}
else {
cout<<" TRY AGAIN... Type it here : "; cin>>coda1;
back="y";}}
cout<<" 3) What is the symbol for the 'Code Separator'? "; cin>>a1;
cout<<"\n";
back="y";
while(back!="n")
{if(a1==';')
{back="n";}
else {
cout<<"\n";
cout<<" TRY AGAIN... Type it here : "; cin>>a;
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 memory container code - DataType |NAME|; is one of them and one of the most commonly used C++ codes."<<"\n";
cout<<"\n";
cout<<" The intention of creating A MEMORY CONTAINER Code is to be able to STORE a data or message that can be accessed ."<<"\n";
cout<<" or retrieved anytime it is needed. NO MESSAGE nor DATA can stand alone, without a MEMORY CONTAINER, except maybe, "<<"\n";
cout<<" the messages we DIRECTLY DISPLAYED using the Display Command Code - cout<<"<<a<<" "<<a<<";"<<"\n";
cout<<"\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 string info; "<<"\n";
cout<<" 6 "<<"\n";
cout<<" 7 return 0;"<<"\n";
cout<<" 8 }"<<"\n";
cout<<"\n";
cout<<" REMEMBER:"<<"\n";
cout<<"\n";
cout<<" In C++, creating a MEMORY CONTAINER code, is only particular to the 'programmer' and not to the User. IT is always hidden in the "<<"\n";
cout<<" Programmer's Page and only the message it contain, is the thing that can be 'revealed' or seen in the User's Display Page."<<"\n";
cout<<" IF we RUN the program, nothing will happen. The important thing, a 'memory container' is OFFICIALLY CREATED in the Programmer's Page."<<"\n";
cout<<" WE WILL DISCUSS further the importance of the different types of memory containers later."<<"\n";
cout<<" For the meantime, a 'glimpse' idea of what a MEMORY CONTAINER is, would be enough."<<"\n";
cout<<"\n";
cout<<" // To understand the 'main' C++ program structure, REFER to source code: IMMERSION TRAINING MODULES - PREPARATORY MODULE by sirjon (module #1)"<<"\n";
cout<<"\n";
cout<<" SEE LINK in the Description Section Below..."<<"\n";
cout<<"\n";
cout<<" Next TOPIC ... MODULE #4- "<<a<<"GETTING FAMILIAR WITH COMBINED USES OF THE INPUT COMMAND CODE, DISPLAY COMMAND CODE AND MEMORY CONTAINER"<<a<<"\n";
cout<<"\n";
cout<<" THE END"<<"\n";
return 0;
}
Comments
Post a Comment