-
About The Course 0
This Course is Only Available On Our App
Dive-in and start learning! Get offline access to all the course contents!
No items in this sectionVerbal 10
-
Lecture2.1
-
Lecture2.2
-
Lecture2.3
-
Lecture2.4
-
Lecture2.5
-
Lecture2.6
-
Lecture2.7
-
Lecture2.8
-
Lecture2.9
-
Lecture2.10
Critical Reasoning 14
-
Lecture3.1
-
Lecture3.2
-
Lecture3.3
-
Lecture3.4
-
Lecture3.5
-
Lecture3.6
-
Lecture3.7
-
Lecture3.8
-
Lecture3.9
-
Lecture3.10
-
Lecture3.11
-
Lecture3.12
-
Lecture3.13
-
Lecture3.14
Abstract Reasoning 8
-
Lecture4.1
-
Lecture4.2
-
Lecture4.3
-
Lecture4.4
-
Lecture4.5
-
Lecture4.6
-
Lecture4.7
-
Lecture4.8
Technical Assesment 6
-
Lecture5.1
-
Lecture5.2
-
Lecture5.3
-
Lecture5.4
-
Lecture5.5
-
Lecture5.6
Coding 4
-
Lecture6.1
-
Lecture6.2
-
Lecture6.3
-
Lecture6.4
Previous year Question Paper With Solution 7
-
Lecture7.1
-
Lecture7.2
-
Lecture7.3
-
Lecture7.4
-
Lecture7.5
-
Lecture7.6
-
Lecture7.7
Model Question Paper With Explanation 3
-
Lecture8.1
-
Lecture8.2
-
Lecture8.3
PseudoCodePseudocode is a way of writing code that does not rely on a particular syntax or programminglanguage. This means that pseudocode is the stuff you write out before you tackle a difficultproblem. If you are a beginner programmer, you have probably needed to write out the problemin layman’s terms first to truly grasp it.It is a detailed yet readable description of what a computer program or algorithm must do,expressed in a formally-styled natural language rather than in a programming language.Pseudocode is sometimes used as a detailed step in the process of developing a program.It is possible to write programs that will convert a given pseudocode language into a givenprogramming language.PseudoCode ComponentsComputation/AssignmentCompute var1 as the sum of x and yAssign expression to var2Increment counter1Input/OutputInput: Get var1, var2, …Output: Display var1, var2, …SelectionSingle-Selection IF1. IF condition THEN (IF condition is true, then do subordinate statement 1, etc. Ifcondition is false, then skip statements)1.1 statement 11.2 etc.Double-Selection IF2. IF condition THEN (IF condition is true, then do subordinate statement 1, etc. Ifcondition is false, then skip statements and execute statements under ELSE)2.1 statement 12.2 etc.3. ELSE (else if condition is not true, then do subordinate statement 2, etc.)3.1 statement 23.2 statement 34. SWITCH expression TO4.1 case 1: action14.2 case 2: action24.3 etc.4.4 default: actionxRepetition5. WHILE condition (while condition is true, then do subordinate statements)5.1 statement 15.2 etc.DO - WHILE structure (like WHILE, but tests condition at the end of the loop. Thus,statements in the structure will always be executed at least once.)6. DO6.1 statement 16.2 etc.7. WHILE conditionFOR structure (a specialized version of WHILE for repeating execution of statements aspecific number of times)8. FOR bounds on repetition8.1 statement 18.2 etc.Pseudocode ExampleExpress an algorithm to get two numbers from the user (dividend and divisor), testing to makesure that the divisor number is not zero, and displaying their quotient using pseudocode1. Declare variables: dividend, divisor, quotient2. Prompt user to enter dividend and divisor3. Get dividend and divisor4. IF divisor is equal to zero, THEN4.1. DO4.1.1. Display error message, "divisor must be non-zero"4.1.2. Prompt user to enter divisor4.1.3. Get divisor4.2. WHILE divisor is equal to zero5. ENDIF6. Display dividend and divisor7. Calculate quotient as dividend/divisor8. Display quotientPractice Examples1. Write pseudo code that reads two numbers and multiplies them together and print out theirproduct.Read num1 , num2Set multi to num1*num2Write multi2. Write pseudo code that tells a user that the number they entered is not a 5 or a 6.Read isfiveIf(isfive = 5 or isfive = 6)Write "your number is a 5 or 6"ElseWrite "your number is not 5 or 6"3. Write pseudo code that performs the following: Ask a user to enter a number. If the number isbetween 0 and 10, write the word blue. If the number is between 10 and 20, write the word red.if the number is between 20 and 30, write the word green. If it is any other number, write that itis not a correct color option.Write "Please enter a number"Read colornumIf (colornum >0 and colornum <= 10)Write blueelse If (colornum >0 and colornum <= 10)Write blueelse If (colornum >0 and colornum <= 10)Write blueelseWrite "not a correct color option"4. Write pseudo code to print all multiples of 5 between 1 and 100 (including both 1 and 100).Set x to 1While(x < 20)write xx = x*55. Write pseudo code that will count all the even numbers up to a user defined stopping point.Read countSet x to 0;While(x < count)Set even to even + 2x = x + 1write even6. Write pseudo code that will perform the following.a) Read in 5 separate numbers.b) Calculate the average of the five numbers.c) Find the smallest (minimum) and largest (maximum) of the five entered numbers.d) Write out the results found from steps b and c with a message describing what theyare:Write "please enter 5 numbers"Read n1,n2,n3,n4,n5Write "The average is"Set avg to (n1+n2+n3+n4+n5)/5Write avgIf(n1 < n2)Set max to n2ElseSet max to n1If(n3 > max)Set max to n3If(n4 > max)Set max to n4If(n5 > max)Set max to n5Write "The max is"Write maxIf(n1 > n2)Set min to n2ElseSet min to n1If(n3 < min)Set min to n3If(n4 < min)Set min to n4If(n5 < min)Set min to n5Write "The min is"Write minPseudo Code Notes