Tag Archives: BASIC

TEA BREAK WITH C++: VARIABLES

Since we learned basic input function at programming with C++, we need to talk a little more about the variables. 

Variables are simply naming some data location in your pc. With variables you can store a value. 

Variables can be global, local or block based. Actually, you can use the same variable name in these locations at the same time. 

  1. #include <iostream>
  2. using namespace std;
  3. int sameVar=1; //defining a global variable at header location
  4. int main(){
  5.     int sameVar=2;    //defining a local variable inside int main
  6.     cout<<“local variable:”<<sameVar; //printing a local variable in int main 
  7.     {
  8.     int sameVar=3; //here we define a variable in any block. 
  9.     cout<<“block variable:”<<sameVar; //printing the block variable
  10. }
  11. //reaching a global variable inside program
  12. cout<<“global variable:”<<::sameVar; //we print global variable in a program
  13. }

 Output;

Here the most important thing we need to talk is the 

variable = value logic. 

Always variable is on the left and the value is on the right of the equivalent sign. 

TEA BREAK WITH C++: Basic Input & endl

On line 9 in the previous example we give 

    int firstNumber, secondNumber, sum;

We define integer variables. These are first number with the definition firstNumber, and the second number defined as secondNumber. And the sum. These we defined as integer by writing “int” at the beginning.  

Continue reading TEA BREAK WITH C++: Basic Input & endl

TEA BREAK WITH C++: Basic Comment Section for All programs

NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/

Here these lines are comment section giving information about the program, and you need to include these lines so that another programmer can understand what it is about easily. 

Continue reading TEA BREAK WITH C++: Basic Comment Section for All programs

TEA BREAK WITH C++: BASIC INPUT / OUTPUT

NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/

As we have seen in the previous section, library we are using for basic input / output operations is the iostream library. That is why we need to include that at the beginning. 

Continue reading TEA BREAK WITH C++: BASIC INPUT / OUTPUT

TEA BREAK WITH C++: MY FIRST C++ PROGRAM

NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/

  1. //my first c++ program
  2. #include <iostream>
  3. using namespace std; 
  4. int main(){
  5. cout<<“hello world!”;
  6. return 0;
  7. system(“pause”);
  8. }
  9. /* This ends 
  10. the file */
Continue reading TEA BREAK WITH C++: MY FIRST C++ PROGRAM

BRIEF HISTORY OF THE ENGINEERING

When does the engineering started? It is a very complex question. Because, people started to construct simple machines before engineering profession is defined. According to that concept we may say ancient times. Because people started to produce simple machines like pulleys, lever and wheels at that time. Some people also started to build tools very long long time ago. These are all before 5000 BC. Except those we may check the written sources to track.

Continue reading BRIEF HISTORY OF THE ENGINEERING

TEA BREAK WITH C++: INSTALLING IDE

NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/

Installing IDE

For all the programming languages the beginning is the printing “Hello World” sentence. So, this is some kind of tradition. But before doing that we need to have the C++ IDE. IDE stands for Integrated Development Environment. So basically, the place where you will communicate with the PC. So, the “language” is coming here. So, for different programming languages there are different environments so that you can talk to your PC and instruct it. 

Continue reading TEA BREAK WITH C++: INSTALLING IDE

TEA BREAK WITH C++ EASILY WITH THIS EASY BOOK

NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/

With this EASY book, I aimed to give the basic programming info as fast as possible without giving so much detail and making you feel bored. Comparing to the other programming books, in this book you will get the essence of the subject, without entering into lots of “unnecessary” details which you may not need to learn at the beginning of learning this language. Especially simple examples are used to show the functions of the codes introduced. I intentionally, tried to keep the text as short as possible so that you can start programming with C++ faster and have time to try it yourself. So this is a great book who wants to start programming as soon as possible and get the idea easily without diving into details. 

Continue reading TEA BREAK WITH C++ EASILY WITH THIS EASY BOOK