um good morning dear students of ide 61.2 for computer programming one i am miscarried vida your olc for this subject and i would like you all to welcome in our virtual class today so how's everybody hope that you are all doing great so we will start our discussion now so from the previous modules you have learned and identified the essential components of the work environment of a programming language so it includes the operating system so operating system is defined as a system software that manages computer hardware software resources and provides common services for computer programs another component is the ide or the integrated development environment which is a software application that provides comprehensive facilities to a computer programmers for software development the ide consists of a source code editor a build customization tools and a debugger another essential component that we have learned is a compiler which translates computer codes written in a programming language into another language which turns a special program into a machine language or code that a computer processor uses then another components is the revision control so the revision control is also known as a version control so it is also known as a source control so it manages of changes made over time and these changes can be a source code that goes into a finished product so moreover we also learned how to configure our work environments to creating a github account i guess you have created an account and downloading a visual studio code in downloading your visual studio code it um it will um add a c plus plus extension or a code runner in order for you to um use the c plus plus environment uh you are also learned how to install a mini w installation manager and its other components so let us uh discuss now the environment of the c plus plus so i have here an introduction for the c plus plus let's um discuss the concept first and the features of the c plus plus so c plus plus is a popular programming language and it is used to create computer programs it is a cross-platform language that can be used to create high-performance applications c plus plus was developed by bijan starstruck it is an extension to the c language so by the way c language was developed by dennis ricci and brian kerningham during 1972 at the bell laboratories but before we have the c language we have the b language which was developed by ken thompson so c plus plus gives from programmers a high level of control over system resources and memory so the language was updated three times in 2011 2014 and 2017 to c plus plus 11 c plus plus 14 and c plus plus 17. so why do we have to study c plus so what are the different reasons why we are going to study this particular programming language so a c plus plus is one of the world's most popular programming languages and it can be found in today's operating system gui or graphical user interfaces and other embedded systems c plus plus is also an object-oriented programming language which gives a clear structure to programs and allows code to be reused or recycled lowering development cost so c plus plus is portable and can be used to develop applications that can be added to multiple platforms c plus plus is fun and easy to learn and c plus plus is close to a c sharp and java which makes it easy for programmers to switch to c plus or vice versa so the next slide will uh basically uh this uh discusses or demonstrates the basic c plus class uh environment so before we uh start using c plus plus we need uh two things we need a text editor which uh we use to write the c plus codes in a compiler which translates the c plus plus code into a language that the computer will understand so the numbers here in the presentation one two three four five six seven those are represented by the number of lines so this lines will guide you in identifying and debugging errors in your program so basically a simple c program which displays the output hello right so we have the hashtag include iostream next line we have using namespace sdd then we have the blank space then we have in main the open tree brace c out hello world return zero and the closed curves so to further discuss the uses of the different syntax of the sequels class we have here an explanation so the line one include io stream iostream stands for input output stream a header file that describes the file stream and this is used to handle data being read from a file as input or data being written into the file as output so these header files are included in the c plus plus library to provide functionality for line 2 we uses namespace std which means that we can use names for objects and variables from the standard libraries and this libraries can be found in the c plus plus compiler so for line 3 we have a blank or white space which are being ignored by the compiler so another thing that always appears in the c plus plus program is line 4 the input so this is the signifier is the main function of the program so any code inside its curly brackets will be executed so by the way the left curly brace signifies the end of the program and the right curly brace signifies the end of the program so for line five we use a c out c out pronounces it is an object used together with the insertion operator for the less than symbol this is used to output or plain text and then we display hello world hello world in this slide is enclosed in double quotes which means that we are going to display a string line six returns zero which ends the main function for your int main and we have to add closing curly brackets to actually end the main function for the next slide we have here different points to remember or notes to remember when executing your program so always remember that every c plus statements ends with a semicolon same with c language and java language so the body of in name could also be written as in mean uh open and close parenthesis your open curly bracey out hello world return zero semicolon and the closed curve degrees so the compiler ignores white spaces just like the comments that are written inside the program they are also ignored by the compiler however it is a best practice in programming that you use multiple lines which makes the code more readable also known as the art of programming so they see out objects together with the insertion operator is used to output values for printings so the c plus plus symbol uh the c plus plus syntax sorry you can add as many c out objects as you want however note that it does not insert a new line at the end of the output so from the previous program hello world so we are going to add another c out or we are going to display another statement which is i am learning c plus plus so in this particular example so the the output will be displayed on the same line so we have hello world i am learning c but if you want your program to uh display on the next line we are going to use the backslash n so for this example we have cr so again so since we're going to display a string of characters so you have to enclose it in a double quote so we have hello world backslash n and then see out i am learning c so the output will be uh displayed on the next line so we have first line hello world and second line and i am learning c plus plus so i i have mentioned a while ago the comments what are these comments so comments can be used to explain the c plus plus code and to make it more readable it can also be used to prevent execution when testing alternative codes and comments are being ignored by the compiler so it basically used as a guide by the programmer to easily debug and identify errors so we have kinds of errors in programming so we have the syntax or the runtime [Music] so we have here two types of errors we have the single line or the multi-line comments so the single line starts with a two forward slashes so any text between this two forward slashes and at the end of the line is ignored by the compiler or it will not be executed by the programmer so here is the example of a single line comment so we have a single line comments before a line of code so before displaying the hello world we uh indicate we place a comment so double double slash she say comment and then c out hello world another example of the single line comment at the end of a line code so we have c out hello world and then slash this is a comment for the multi-line comment we are going to start with a slash asterisk and ends with as3 so any text between the symbols are again being ignored by the compiler so we have include iostream using namespace std and then after your main program or the main function we're going to write your code so the code below will print hello world to the screen and it is amazing so see out hello world later so we also use as different we also use as variables in program so this uh variables are containers for storing data values in c plus plus and there are different types of variables defined in different keywords so by the way in programming we have keywords or reserved words so these keywords or reserved words um should not be used as a variable or identifier in your program because they have special functions in programming so these are the examples of the variables so we have the int or the integer it stores integer or whole numbers without decimal example one two three or negative one two three fifty nine one two three next we have double it stores floating uh point numbers or numbers with decimal points such as 19.99 or negative 19.99 uh 523.23 and so on and so forth next we have the char or character store single character such as a b and um it is enclosed in a single code next we have streams so stores text such as hello world string values are surrounded by then we have the bull or the boolean which stores values with two states true or false or one and zero so how do we declare variables so to create a variable you must specify the type and assign it a value so the syntax is type variable is equal to value so the type here is one of c plus plus type such as integer um double float and variable is the name of the variable such as for example an x y num or my name and the equal sign is used to assign values to the variable so how do we declare variable inside a program so to create a variable that should store a number so we have here an example so after your main function we declared here a variable so we have in my num is equal to 15. so this particular type of variable is a local variable so because it is declared inside the main function so we have c out my num and then return 0 and close curly brace so what is the output of the program so basically the output of the program is you are just going to display the variable mynum which is 15. so next we have other data types demonstration so we have in my num is equal to five which is for an integer so basically without a decimal point double my float num so a floating point number with decimal we have here for character which is enclosed in a single code and a string my text which is enclosed in a double quotes and then for boolean which can have a value of true or false so how do we add variables inside our program so to add a variable to another variable you can use the plus operator so for example we have here an integer x so integer is a data type which holds a whole number value x is a representation of your integer which will have or hold the value of 5 as well as integer y which will hold a value of 6. so if you're going to um add this one so we have in sum is equal to x plus y so basically 5 6 is equal to 11 so it will display a value of 11. so what are those c plus plus identifiers so c plus plus identifiers are user defined so all c plus plus variable must be identified with unique names so these unique names are called identifiers identifiers can be a short means like x and y a b c or more descriptive names so it is recommended to use descriptive names in numbers to create understandable and maintainable code for example if you're going to um generate a calculator it's better that you use identifiers such as sum difference or add subtract multiply divide so these are the rules for the general rules for constructing names for variables so names can obtain letters digits and underscores names must begin with a letter or an underscore names are case sensitive so what do you mean by case sensitive so since c plus plus implements a sensitivity lowercase and uppercase letters are treated differently so that is case sensitivity so in this particular example so my var with capital v and my form the small v are different variables so the names cannot contain white spaces or embedded blanks or special characters like exclamation point hashtag percentage and it cannot also use reserved words or keywords because they have special functions in your c program so what are c plus plus constant so when we talk about constant these are values that cannot be changed during program execution um when you do not want others or yourself to override existing variable values use the cons keyword this will declare the variable as constant which means unchangeable and read only so we have here an example of constant value so the minute per hour has a constant value of 60 and a pi which has a constant value of 3.14 so float because it has a decimal point and in because it's a whole number so this is the example so cons in so for constant integer means per hour will hold a value of 60 and constant float pi which will have a value of 3.14 so we are going to display the value of the minutes per hour which is 60 here and the value of pi which is 3.13 so we're done with the variable declaration identifier now let's try to uh discuss user input so you have already learned that c out is used to output or print values now we will use c in to get user input so i see it is a predefined variable that reads data from the keyboard with the extraction operator or the two less than the two greater than symbol in the following example the user can input a number which is stored in the variable x then we are going to print the value of x so we have here integer x as your variable we have c out type a number so for our comment here so remember this is a comment so you will be asked to input a number or type a number and then c out it will hold the value of your inputted number so get user input from the keyboard and then it