Transcript for:
Flowchart and Pseudocode Basics

[Music] sequential flowchart and sudoku design for sequential flowchart symbols used are the following the terminal symbol or the losses symbol the input and output symbol and the direction flow lines for through the hood syntax there will be two syntaxes and that is for the output syntax and for the input syntax for the output syntax these are the following options you can use in displaying or prompting values or variables so display and then if you want to prompt the user you need to double click code the screen and you prompt it and put a string within the double quotation mark second syntax is display bar meaning you are just displaying the process value or the processed variable then the other option is display in your string comma then for you may have for example a stream before you display the output or the output variable for the input if you want to input one value so you use the word accept and then the variable for multiple inputs you may use accept then bar one for the first variable separated with gamma then variable two separated with comma then variable three etc or you may also use single accept a single multiple accept with single variable so this is accept then par one then another accept for inputting the next variable or by two so let's have an example we're going to design an algorithm and we're going to design a flowchart in a pseudocode to find the perimeter and area of a rectangle so the values of the equations are given already below perimeter should be equals to two times parenthesis length plus width and the area will be length times width so let's have the solution on the next slide so for this first example so we need to get the perimeter and the area so this is very easy because the equation has been already um here or there in the problem so for us to be easily doing the flow chart or creating the flowchart and the soda code we need to identify first what's what should be the input okay what must be the output so that we can get the process so here the process is just getting the perimeter and the area of the rectangle okay so now how are we going to identify the input so mostly the input are within the equation so for the perimeter we need to get the length and the weight as well as the area length and the width so our input here is variable length i'm going to make use of length and variable we are going to use the word wig only then there will be two outputs output should be the perimeter and the area so i'm going to spreading for my variable area as for my area okay so now so we already identify what should be the input and the output and what should be the process so again as mentioned oh from the previews presentation if that is just an arithmetic expression we're going to make use of the box or the processing one okay so for the pseudocode first so we're going to make use of passenger symbol then we're going to use start flow direction line going to the going below and then we're going to use the iocm one so that's for the input so i'm going to label it with the word input then i'm going to use len comma with another flow lines process make sure that you follow the ipo input then process then output so this is the i this is the p and later on will be the o so here we're going to use padding equals two times parenthesis then and then i have the area is equals to then times me okay then direction flow lines another io symbol this time i'm going to use output and then this one is the bearing and the area so again this is the o ipo since we're done with output that means we're going to end the flowchart okay for the sudo code format so this is the flowchart format so let's have the soda code so for the pseudocode we have variables used so we need to put below variables use all the variables we use from the uh flow chart okay so we have len and then we are pneumatic you can also have perim and area are also inhumanity then i have the begin begin means the same as start then instead of input i can use accept length comma with then process pairing equals two times length plus width and then area equals length times v and for the output we can use display variable and display ave but for me i'm going to use display perimeter equals comma and another display area equals double code area so that's the solution for the flow chart and so the food in getting the perimeter and the area of a rectangle let's have another sequential structure example we need to input the temperature in celsius and output the corresponding temperature in fahrenheit and the formula is as follows fahrenheit is equal to 9 over 5 multiplied to celsius plus 32 so if we're going to take a look at the formulator formula has been given again and we need to identify what should be the input what should be the output and what must be the process but please take note that the equation should be 9 divided by 5 and the 9 divided by 5 should be multiplied to cell shoes so make sure that you use the correct usage of arithmetic expression symbols in doing the flowchart and pseudocode so again the given formula is fahrenheit is equivalent to nine over five parentheses cell shoes plus 32 so in this case we need to follow the correct format of arithmetic expression so [Music] you