On Day 1 : “Getting Into Programming World”
> Why C++ in software development
> Steps In developing a C++ program
> How to enter, compile, and link your first C++ program
Brief History:
Early On, Programmers worked with Machine Language which were represented as long strings and zeros.
After a while the assemblers were invented to map machine instructions to the human-readable those where ADD and MOV .
Meanwhile higher-level-languages were evolved those where BASIC & COBOL.
These languages helped people in approximating words and sentences, for example Let P = 2000.
This instruction was translated into machine language by interpreters and compilers.
Interpreter :
An interpreter translates and executes a program as it reads it, turning the program instructions directly into actions.
Compiler :
A compiler translates source code into an intermediary Language. This step is called compiling, and that produces an object file. The compiler then invokes a linker, which combines the object file into an executable program.
(I Hope You are OK with the History of Programming World)
Programming Language is a Source for Problem Solving :
Programming languages usability now-a-days are not as languages that were used in past 10 to 20 years.
It is not only used for managing the large amount of data or processing raw data they are getting used by the people in problem solving, business problems solving and etc.
Now-a-days we use the friendly user interfaces namely menus, multiple windows, dialogue boxes and etc.
Evolution of Programming Languages:
Procedural Language : Also called as function or Method . It works of specific instructions executed one after the other.
Structured Programming : It will help you to keep a track on which function is called and which function is responding to it by which what was the data change status.
Example for Structured Programming : Let me find the best college offer Chemical Engineering across India in which a student need low fee payment, that might be complex . However, we can find it by breaking it down into the following subtasks:
1. Count how many Colleges you have across India.
2. Divide it by Sectors (Govt , Private, Affiliated & so on .
3. Total all the Sector Colleges.
4. Divide the total by the number of Colleges by NBA Accreditation.
5. Then divide the colleges based on the NAAC Grade.
Then choosing the best colleges can be broken down into the following steps:
1. Get record of colleges with NAAC Grade above A+.
2. Look for Chemical Branch in the Institute (college)
2. Find the fee structure
Then choosing the college according to the low college fees after which the steps:
1. Lookout for the college location.
2. Add the college to the wish list if nearer to the location of your residence or with the hostel facilities and with low hostel fees .
3. Get the next College record and do the same.
In turn, obtaining each colleges record can be broken down into the following:
1. Open the files of colleges.
2. Go to the correct record.
3. Read the data and get joined
By which you support in saving your time in searching the best colleges from the rest.
Structured programming is often called procedural programming because of its focus on procedures rather than focusing on "Objects".
Second, people were in need of reusing functions. But functions that work for a typed data often could not be used with other typed data because the approach might be different which made in limiting the benefits gained.
Object-Oriented Programming (OOP)
OOP will provide various techniques in managing enormous complexities along with achieving the reusability factor of software components by grouping them as object (s).
Use of OOP is to model the "Objects" rather than simply using it as "Data" all the time. Object might be Colleges (From the above example).
Objects have characteristics, also called properties or attributes such as Govt College, Private College, NAAC Grade, NBA (From the above example).
They also have capabilities, also called operations or functions such as choose_this_college( ) or ignore_this_college( ) (From the above example). The main work of OOP is to represent these objects.
C++ :
C++ fully supports object-oriented programming,
It is due to 3 concepts in it (These are just like 3 children support family in being stronger)
1. Encapsulation,
2. Inheritance (Reuse) &
3. Polymorphism.
Encapsulation :
Inheritance (Reuse) :
Polymorphism:
Should I Learn C First? :
C++, Java, and C# :
Steps In developing a C++ program :
How to enter, compile, and link your first C++ program (Development Cycle) :
To create and test the Hello World program,
follow these steps:
1. Start the compiler.
2. Choose File, New from the menus.
3. Choose Win32 Console Application and enter a project name, such as hello, and click OK.
4. Choose An Empty Project from the menu of choices and click Finish. A dialog box is displayed with new project information.
5. Start your hello.cpp program
6. #include<iostream> // iostream library helps in input and output operations.
using namespace std; //namespace will help in avoiding confusion
int main( ) //main function
{
cout<<"Hello World\n";
return 0;
}
Summary:
After reading Day-01 Blog page, you should have a good understanding of how C++ evolved and what problems it was designed to solve. Today, you learned how to enter, compile, link & run first C++ program, and what the normal development cycle is. You also learned a little of what object-oriented programming is all about. You will return to these topics during the next blog pages.
Comments