Step 4 - How to start learning a computer programming language?

Good Evening, In first three steps of this article series "How to start learning a computer programming language?", I have discussed the three tricks for beginners to easily grasp programming. The first article concluded that "programming is an art of thinking", while in the second article "the importance of using boxes of data" for understanding a computer program logic, and the third one was about "paper and pencil is best tool for beginner to start programming".

In the fourth steps we are going discuss the impact of our computer program on user interface, yes, we are going to learn while our computer program is working with boxes in computer memory it must have some users to give some inputs of data and see the output results. In every programming language input / output is the compulsory part. I think you can learn any programming language as your first programming language.

I am going to choose C Sharp (C#). It is one of best technologies offered by Microsoft, while using C# you can make a classic black window program known as console application, websites or web applications can be developed, mobile application for all mobile platforms like android, iOS, and Microsoft windows mobile, web services or web api can be developed, and cloud services can also be easily developed, desktop application know as windows form application can be easily developed, platform independent application can also be developed and much more.

Now In this article we are going to divide paper in different sections, it will be divided into three sections. One section is for program instructions, second is for computer memory and boxes with data, while the third one is for user interface or computer screen. Computer screen will display the users input values and output results. In C# the output statement is Console.WriteLine("Message String"); The "Message String" is the message we want to display on the computer screen, and the input statement is VariableName = Console.ReadLine(); The VariableName is any variable in which the input value will be stored. The computer memory will make processing of the inputs and produce results as per instruction defined in the computer instruction section. The page will looks as follow.

Now I am going to write a simple computer program instruction in C#, that will get two input values from user, and calculate the sum of two numbers and store the result in an other box, and finally the result will be displayed to the user on computer screen. I have written seven (7) simple computer program instructions. I have displayed seven (7) images to explained the impact of each computer instruction on computer screen and computer memory. The major trick in this article is to line by line execute the program instruction and write its impact on paper. Please carefully look at the following screen program instruction section have seven (7) instruction written, when the first line is executed, it created the three (3) boxes in computer memory. The name of first box is x, second is y, and third is z. The sequence of the boxes will be same as the sequence in the first line int x,y,z;. so due to this reason the box of x is created first, box of y is created after that, and in the last the box for z is created.

The second line of the output instruction. Every output instruction displays the result on the screen. so Enter X is displayed and cursor ( _ ) goes on the second line because this instruction writes the string in double quotes "Enter X" and goes to next line. The third line is input instruction. The input instruction is a blinking cursor ( _ ). It request user to input some value. The user input seventeen (17) and this values goes to box x. The fourth line is again an output instruction that displayed Enter Y on the screen and cursor ( _ ) goes to next line. the fifth line is again input instruction. it shows a blinking cursor ( _ ) on screen. The user input the value nine (9) and this values is stored in the box y. the sixth line adds the value of two boxes x (17) and y (9) and calculates sum of both boxes and stored it into third box z (26). the seventh line is to display the value of z box on the screen X + Y 26. The following images are displaying the impact of all these instruction on paper.

Please practice the same example on your paper. please try to make four (4) more programs on your paper with input / output statements. see the following task you need to perform.

write a program to subtract two numbers and display the difference on screen.

write a program to multiply two numbers and display the product on screen.

write a program to divide two numbers and display the quotient on screen.

write a program to interchange / swap the value of two variables with each other.


Congratulations! for those who have successfully practiced the example we have practiced in this article and other four examples that were assigned for practice. you have successfully learned the fourth step required to learn a computer programming language. I hope to come back the the fifth step of this article series very soon.


Muhammad Arsalan

Digital Marketing Head at Luxury Escapes | Former Digital Marketing Director at GI Properties l Digital Marketing Strategist l PPC & Social Media Marketing Specialist l Lead Generation l Web & Graphics Designer

7 年

Very Nice Sir...

Sohaib Ahmed

Software Engineer

7 年

awlaa sir.

要查看或添加评论,请登录

Omer Aziz的更多文章

社区洞察

其他会员也浏览了