CODING
FOR
ABSOLUTE BEGINNERS
Master the Basics of Computer Programming with Python, Java, SQL, C, C++, C#, HTML, and CSS
ANDREW WARNER
Copyright 2021 by Andrew Warner.
All rights reserved.
No part of this book may be reproduced in any form on by any electronic or mechanical means, including information storage and retrieval systems, without permission in writing from the publisher, except by a reviewer who may quote brief passages in a review.
Book and cover design : Raphael A.
Printed in the United States of America
ISBN-13 : 9798543586372
First Edition : July 2021
For information on translations, please e-mail andrew@aqpub.com, or visit http://www.aqpub.com
DEDICATION
M Y P A R E N T S
For raising me to believe that anything is possible
A N D M Y W I F E
For making everything possible
CONTENTS
PREFACE
Coding for Absolute Beginners is a complete and authentic guide for students who are determined to learn the best programming approaches, techniques, and methodologies. As the software industry is updated with the latest coding languages and tools every day, it is mandatory to adopt new skills and technologies to survive in the competitive market. Reading has always been a vital resource for students and learners as they can improve their performance and output by implementing the latest techniques and programming methodologies.
This book is a successful programming manual covering all of the major programming languages, syntax, and best practices that are suitable for both beginners and professionals. Before entering into the programming world, there are several important factors that need to be looked at in order to develop sharp problem solving and analytical skills. Therefore, this book targets novice programmers and has been updated with solutions and answers to almost every question you might have about Java, SQL, C, C++, C#, Python, HTML, and CSS.
I always emphasize the acquisition of basic knowledge and skills. This book will not make you a programmer in just one hour or overnight, but it will build a solid foundation for your programming career. After reading this book, your basic knowledge of programming will increase, as will your proficiency in any programming language.
Many people have helped me in many ways in writing this book with their important feedback and encouragement and correcting various mistakes. I am eternally grateful to all of them. Especially, Mr. Steve, my then CS thesis supervisor at Harvard University. He knew more than a year ago that I was writing a programming book. After sending him the draft of my book in December (2020), his reply was- "I just have gone through your book. I have been thinking about writing a book like this for the last five or six years- you have done it- I do not need to do it anymore. thank you."
On a personal level, I have to thank my wife Rachel and son Aaron for their never-ending patience and support.
I hope that Coding for Absolute Beginners be your best friend in your programming journey and help you become proficient in computer programming.
May the source be with you. </>
CHAPTER ONE
What is Programming?
Generally, programming is referred to as a set of instructions that the computer utilizes to complete certain tasks. This is also known as coding. Before delving into an in-depth discussion, you must be well aware of how programming works and how the set of instructions are processed by the computer. When you are able to follow the correct approach of writing computer programs, it can become quite easy to implement functions, operators, and syntax for any language. Moreover, programming is a way to communicate with computers through binary language for which programmers need to understand high level and low-level languages including syntax as well.
In order to solve a problem with a computer, users are required to present the solution for the problem through a set of instructions which can be utilized to execute the program. As a program is a collection of instructions that are required to solve a problem, appropriate statements and functionality must be added in order to achieve the desired outcome. For example, if you are given the task to develop a program to add two integers (numbers), the set of statements that will perform the addition operation will be known as the program. The algorithm for adding two integers will be expressed through the statements of a particular computer language like C++, C, C# or Java. If the program is not able to execute properly, there might be a problem with your algorithm or syntax because the compiler or editor will be unable to execute the program if there are any type of errors or syntax mistakes.
Programming can be better learned through practice and writing code rather than learning long methodologies or complex techniques. Although it might seem like a fun activity at the start, it can also turn out to be time-consuming and frustrating if you are not following the correct approach. Furthermore, this book will make it easier for beginners to choose the most suitable programming languages and enter the world of computer programming without much hassle.
Problem Solving with Computer Programming
In essence, a computer program is supposed to solve a specific problem by following a set of instructions. People can write a program by following multiple techniques and approaches. In order to solve a problem, you need to determine the code flow and fulfill the requirements step by step to achieve the desired output. In some cases, your computer program may not work even after hours of struggle because of inappropriate syntax or flow for which you need to focus on the sequence of instructions and computer programming language requirements.
Using this example of preparing a wooden table, you would need to write down the instructions as follows:
Get the most suitable pieces of wood required to make the table.
Get the essential tools and equipment that will be used during the procedure.
Join the pieces and build your table.
Polish the end product to make it look attractive.
When giving such instructions to the computer, you need to be more specific and precise because a computer cannot perform operations on its own. As it is created to follow instructions, your computer program should always follow an incremental approach in order to achieve the desired outcome.
On the topic of the natural language of a computer, they are unable to understand human language and therefore, we need to communicate with the system through another language called binary code. Binary code is made up of a series of 1s and 0s and is the natural communicating language of computers. In order to help the computer understand human language, we use translators and editors for writing programs. Translators have the capability to convert the source code into the machines language.
There are multiple types of translators known as Interpreters, Compilers, and Assemblers. Interpreters are generally used to interpret languages which are then processed line by line to run the final program. Moreover, any syntax errors or mistakes are also outlined by the interpreter so the programmer can clear out the mistakes and execute the program.