[Music] another type of constant is character constant a character constant is enclosed with single quotation mark and it includes numbers 0 to 9 letters a to z either a small letter or a big letter and all special character like space comma percent sign dollar sign dash underscore sign ampersand sign etcetera that may be included so these are examples of a valid chart after constant a j that is enclosed with single quotation mark percent sign that is enclosed with single quotation mark appear eu that is enclosed with a single quotation mark is considered as a character
constant number one since this is enclosed with single quotation mark we cannot say that one is a numeric constant but rather a character constant g also an example of a character constant that is enclosed with single quotation mark again take note that the entire character constant must always be enclosed in single quotation mark one before the first character and one after the character no more no less so the following examples of incorrect character constants are j we started it with single quotation mark but it doesn't end with a single quotation mark for this example we
do not start it and denote it with a single quotation mark but there is a single quotation mark at the end of the character so this is invalid another type of a constant is a string constant this is a character or group of characters enclosed in double quotation marks the number zeros to nine letters a to z capital or small letters and all specials character letter characters like a space again comma percent sign dollar sign dash sign underscore etc may be included so these are examples of a valid and correct samples of string constant z
that is enclosed with double quotation mark say glorian with a double quotation mark period with the double quotation mark 1 2 2 5 again is not considered as a numeric constant since it is enclosed with double quotation mark that is considered as a string constant double quotation marks c and g double quotation mark so that's also a valid string constant so take note that the entire string constant must always be enclosed in double quotation mark one before the first character and one after the last character no more no less so here are the following incorrect
string constant so again gloryn es fuentes is invalid because we started it only with a double quotation mark but we do not end it with a double quotation mark to make it valid put double quotation mark at the end of the last character same thing as mitc we started it without a double quotation mark and ends it with a double quotation mark to make it valid we put double quotation mark before the first character power ranger is just the same as glory and fuentes we need to put double quotation mark after the last character after
assigning the constants we need to identify our variables so when we are dealing with variables variables is a portion of the computer's main memory used to store a numeric constant or a string constant or a character constant so the value stored in the variable must be given a unique variable name but it can hold one value at a given time so these are the guidelines and how are we going to make variable names so we need to conform with the following requirements number one or letter a must contain only letters numbers and or an underscore
and must begin with a letter must end either with a letter or a number must be unique that is not a name of another variable so let's say for example you created two variables named as num to num so that is invalid so we need to name it as unique as possible so if you want to make use of num two nums make use of either a letter or a number before ah after the last character of num so let's say for example num1 and num2 or it can be num a or nambi to make
it unique and must not be a key word okay so a key word like in so the hold we use the word accept so please do not make use of accept while and the like a variable may be one of the following types can be a numeric type a character type string type or an array type so take note all variable names are case sensitive that is upper and lower case letters are differentiated for example the variable total is not the same as the word total with a small letters so the following are examples of
incorrect variable name so how do we make year code as a valid one okay so your code is a variable but it is invalid to make it valid it's either i'm going to put your code okay without a space or a year code in addition to year end code and need to put an underscore to make it valid right next density r is invalid so we do not start it with a number so to make it valid omit 10 and start it with ctr this one is totally invalid as mentioned a while ago we need
to start it with a letter next this one is invalid because of the equal sign to make it valid to make it valid omit the equal sign next is expressions expressions is or are a group of program elements consisting of operands and operators operands can be a constant a variable or an array element operators can be arithmetic logical relational and or string take note that expressions always yield a value of a certain type depending on the type of expressions used so here we have three expressions the first expressions that we're going to discuss is the
arithmetic expressions so take note that in programming or in flowchart and in pseudocode we follow the hierarchy or priority of operators so number one if we encounter expressions in parentheses we need to do the equations or the expressions first within the parentheses then followed by multiplication that symbolizes asterisk sign slash four division and percent sign for modulus division so in this case if they if the level of hierarchy or priority of operators are just the same like number two we follow the rule of uh left to right okay same thing as number three the plus
and minus so later on i'm going to give you an example of how are we going to prioritize the expressions in arithmetic before we proceed to our example let us first differentiate the symbols percent sign and the slash sign so again slash sign is for the division so when we say division we are getting the quotient for modulus division in this case we are getting the remainder so let's say for example i have 4 divided by 2 so the answer here is two while for modular two it means we are getting the remainder remainder here
is zero [Music] you