Successfully reported this slideshow.

our c prog work

1,086 views

Published on

Published in: Career, Technology, Education
  • Be the first to comment

  • Be the first to like this

our c prog work

  1. 1. UNIT - 3 PROBLEM SOLVING AND OFFICE AUTOMATION
  2. 2. Program <ul><li>Program is a collection of instructions that will perform some task. </li></ul>
  3. 3. Problem Solving Steps <ul><li>Analyse the problem. </li></ul><ul><li>Identify the solution for the problem and divide it into small task. </li></ul><ul><li>Algorithm has to be prepared. </li></ul><ul><li>Based on the algorithm the program will be created. </li></ul><ul><li>Then it has to be executed. </li></ul>
  4. 4. Program Development Cycle <ul><li>Methodologies </li></ul><ul><li>Program planning method </li></ul><ul><li>Waterfall method etc,. </li></ul>
  5. 5. Program planning method Specification Review Informal Design Test & Debug Coding Formal Design Maintaining
  6. 6. <ul><li>Specification review </li></ul><ul><ul><li>collect the requirements </li></ul></ul><ul><ul><li>understand the requirements </li></ul></ul><ul><li>Informal Design </li></ul><ul><ul><li>Identifies the major tasks </li></ul></ul><ul><ul><li>Identifies the subtasks </li></ul></ul><ul><li>Formal Design </li></ul><ul><ul><li>It converts the informal design to some format that can be understand by others. </li></ul></ul>
  7. 7. <ul><li>Coding </li></ul><ul><ul><li>It converts the Design into Programs. </li></ul></ul><ul><ul><li>It translate these programs to machine language. </li></ul></ul><ul><li>Test & Debug </li></ul><ul><ul><li>It use sample data to test whether it works properly. </li></ul></ul><ul><ul><li>It also eliminate the errors. </li></ul></ul>
  8. 8. <ul><li>Maintaining </li></ul><ul><ul><li>It Modifies the programs if necessary. </li></ul></ul>
  9. 9. Waterfall method Feasibility Analysis Maintenance Testing Impl Design
  10. 10. <ul><li>Feasibility </li></ul><ul><ul><li>It determines whether it is possible to create the project or not. </li></ul></ul><ul><ul><li>It also produce the plans and the estimates. </li></ul></ul><ul><li>Analysis </li></ul><ul><ul><li>It get the requirements from the customer. </li></ul></ul><ul><ul><li>It analysis the requirements. </li></ul></ul>
  11. 11. <ul><li>Design </li></ul><ul><ul><li>It is the process of designing how the requirements to be implemented. </li></ul></ul><ul><li>Implementation </li></ul><ul><ul><li>It converts the designs into code. </li></ul></ul><ul><ul><li>After coding it use language translators to compile the code. </li></ul></ul>
  12. 12. <ul><li>Testing </li></ul><ul><ul><li>Here the modules are integrated together. </li></ul></ul><ul><ul><li>Then the project is tested and find whether it meets the customer/user requirements. </li></ul></ul><ul><li>Maintenance </li></ul><ul><ul><li>It make modifications based on the customer feedbacks. </li></ul></ul>
  13. 13. Algorithm <ul><li>Algorithm is a finite sequence of instructions required for producing the desired result. </li></ul>
  14. 14. Characteristics <ul><li>The steps in the algorithm must be unambiguous . </li></ul><ul><li>It should be written in sequence. </li></ul><ul><li>Ensure that the algorithm will terminate. </li></ul><ul><li>It should conclude after a finite number of steps. </li></ul>
  15. 15. Factors used to judge the algorithm <ul><li>Time </li></ul><ul><li>Memory </li></ul><ul><li>Accuracy </li></ul><ul><li>Sequence etc,. </li></ul>
  16. 16. Representations <ul><li>Flowcharts </li></ul><ul><li>Normal English </li></ul><ul><li>Pseudo code etc,. </li></ul>
  17. 17. Example <ul><li>Addition of two numbers </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read a, b </li></ul><ul><li>Step3: Add the value of a with b and store the result in c. </li></ul><ul><li>Step4: Display the value of c </li></ul><ul><li>Step5: Stop </li></ul>
  18. 18. Flowcharts <ul><li>It is the pictorial representation of the algorithm. </li></ul>
  19. 19. Flowchart Symbols <ul><li>Terminal symbol </li></ul><ul><ul><li>It is used to represent the start, end of the program logic. </li></ul></ul><ul><li>Input/Output </li></ul><ul><ul><li>It is used for input or output. </li></ul></ul><ul><li>Process Symbol </li></ul><ul><ul><li>It is used to represent the calculations, data movements, initialization operations etc,. </li></ul></ul>
  20. 20. <ul><li>Decision Symbol </li></ul><ul><ul><li>It is used to denote a decision to be made at that point </li></ul></ul><ul><li>Flow lines </li></ul><ul><ul><li>It is used to connect the symbols </li></ul></ul><ul><li>Connectors </li></ul><ul><ul><li>It is used to connect the flow lines. </li></ul></ul>
  21. 21. Guidelines for preparing flowcharts <ul><li>It should be simple. </li></ul><ul><li>Standard symbols should be used. </li></ul><ul><li>The flow lines should not intersect each others. </li></ul><ul><li>In case of complex flowcharts use the connectors symbols. </li></ul>
  22. 22. <ul><li>Only one flow line should enter the process symbol and only one flow line should come out from a process symbol. </li></ul><ul><li>Only one flow line used with the terminal symbol. </li></ul>START STOP
  23. 23. <ul><li>Only one flow line should enter the decision symbol and two or three flowlines may leave from the decision symbol. </li></ul>
  24. 24. Benefits of Flowcharts <ul><li>Makes Logic Clear </li></ul><ul><li>Communication </li></ul><ul><li>Effective Analysis </li></ul><ul><li>Useful in coding </li></ul><ul><li>Useful in Testing etc,. </li></ul>
  25. 25. Limits of Flowcharts <ul><li>It is difficult to use flowcharts for large program </li></ul><ul><li>Difficult to modify </li></ul><ul><li>Cost etc,. </li></ul>
  26. 26. Pseudocode <ul><li>Pseudo means imitates and code means instruction. </li></ul><ul><li>It is formal design tool. </li></ul><ul><li>It is also called Program Design Language. </li></ul>
  27. 27. Keywords <ul><li>READ,GET </li></ul><ul><li>PRINT,DISPLAY </li></ul><ul><li>COMPUTE,CALCULATE </li></ul>
  28. 28. Guideline for writing Pseudocode <ul><li>Steps should be understandable </li></ul><ul><li>Capitalize the keyword. </li></ul><ul><li>Indent to show hierarchy. </li></ul><ul><li>End multiple line structure etc,. </li></ul>
  29. 29. Example <ul><li>READ a,b </li></ul><ul><li>C=a+b </li></ul><ul><li>WRITE C </li></ul><ul><li>stop </li></ul>
  30. 30. Example <ul><li>READ a,b </li></ul><ul><li>IF a>b </li></ul><ul><li>PRINT a is greater </li></ul><ul><li>ELSE </li></ul><ul><li>PRINT b is greater </li></ul><ul><li>ENDIF </li></ul><ul><li>stop </li></ul>
  31. 31. Advantage & Disadvantage <ul><li>It can be easily modified </li></ul><ul><li>It can be understood easily </li></ul><ul><li>Compare to flowchart it is difficult to understand the program logic. </li></ul>
  32. 32. <ul><li>Sequence control structure </li></ul><ul><li>Flow chart Pseudocode </li></ul><ul><li>Process 1 </li></ul><ul><li>Process 2 </li></ul><ul><li>Process n </li></ul>Design Structures Process 2 Process n Process 1
  33. 33. <ul><li>Sequence control structure </li></ul><ul><li>The instructions are computed in sequence i.e. it performs instruction one after another. </li></ul><ul><li>It uses top-down approach. </li></ul>Design Structures
  34. 34. Example START C=a+b Print c Read a,b STOP
  35. 35. SELECTION CONTROL STRUCTURE <ul><li>It is used for making decisions. </li></ul><ul><li>It allows the program to make a choice from alternative paths. </li></ul><ul><li>IF …THEN </li></ul><ul><li>IF …THEN… ELSE </li></ul><ul><li>CASE etc., </li></ul>
  36. 36. IF…THEN <ul><li>Pseudocode Flow chart </li></ul><ul><li>IF condition THEN </li></ul><ul><li>process 1 </li></ul><ul><li>. </li></ul><ul><li>. END IF </li></ul><ul><li>. </li></ul><ul><li>. </li></ul>If condition NO YES Process 1
  37. 37. Example Start Read a If a>0 Print a is Positive Stop no yes
  38. 38. IF…THEN…ELSE <ul><li>Pseudocode Flowchart </li></ul><ul><li>IF condition THEN </li></ul><ul><li>process 1 </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>ELSE </li></ul><ul><li>process 2 </li></ul><ul><li>. </li></ul><ul><li>. END IF </li></ul><ul><li>. </li></ul><ul><li>. </li></ul>If condition YES NO Process 1 Process 2
  39. 39. Example Start Read a,b If a>b Print a is Greater Print b is Greater Stop no yes
  40. 40. CASE structure <ul><li>Pseudocode Flow chart </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>CASE Type </li></ul><ul><li>Case Type-1: </li></ul><ul><li>Process 1 </li></ul><ul><li>Case Type-2: </li></ul><ul><li>Process 2 </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>Case Type-n: </li></ul><ul><li>Process n </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>END CASE </li></ul>Type 1 Type 2 Type 3 Process 1 Process 2 Process 3 no no no yes yes yes
  41. 41. start stop Read m1,m2,m3 Avg=(m1+m2+m3)/3 If Avg>=60 If Avg>=50 If Avg>=35 Fail Print First Class Print Second Class Print Third Class Example: Finding the Grade
  42. 42. Looping control structure <ul><li>It is used to execute some instructions several time based on some condition. </li></ul><ul><li>WHILE loop </li></ul><ul><li>Do…WHILE loop etc., </li></ul>
  43. 43. WHILE Loop <ul><li>Pseudocode Flow chart </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>WHILE condition </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>Body of the loop </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>END WHILE </li></ul>Body of The loop condition no yes
  44. 44. Example Start Num=0 Num=Num+1 Print Num while Num<5 stop no yes
  45. 45. DO…WHILE Loop <ul><li>Pseudocode Flow chart </li></ul><ul><li>DO </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>Body of the loop </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>WHILE condition </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>END WHILE </li></ul>Body of The loop condition no yes
  46. 46. Example Start Num=0 Num=Num+1 Print Num while Num<5 stop no yes
  47. 47. Example: Finding the area of a circle <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of r </li></ul><ul><li>Step3: Calculate area = 3.14*r*r </li></ul><ul><li>Step4: Print area </li></ul><ul><li>Step5: Stop </li></ul>
  48. 48. Pseudocode <ul><li>Set area </li></ul><ul><li>READ the r </li></ul><ul><li>COMPUTE area=3.14*r*r </li></ul><ul><li>PRINT area </li></ul><ul><li>stop </li></ul>
  49. 49. Flowchart START area=3.14*r*r Print area Read r STOP
  50. 50. Find the largest among three Numbers <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of a, b, c </li></ul><ul><li>Step3: IF (a>b) and (a>c) THEN </li></ul><ul><li> print a is largest </li></ul><ul><li> ELSE IF (b>c) THEN </li></ul><ul><li>print b is largest </li></ul><ul><li> ELSE </li></ul><ul><li>print c is largest </li></ul><ul><li>Step4: Stop </li></ul>
  51. 51. Pseudocode <ul><li>READ a, b, c </li></ul><ul><li>IF (a>b) and (a>c) THEN </li></ul><ul><li>WRITE a is largest </li></ul><ul><li>ELSE IF (b>c) THEN </li></ul><ul><li>WRITE b is largest </li></ul><ul><li>ELSE </li></ul><ul><li>WRITE c is largest </li></ul><ul><li>ENDIF </li></ul><ul><li>stop </li></ul>
  52. 52. Flowchart START Print b Is largest Read a,b,c stop If (a>b) and (a>c) If b>c Print a Is largest Print c Is largest no yes yes no
  53. 54. Finding roots of the Quadratic equation <ul><li>Step:1 Start </li></ul><ul><li>Step:2 Enter the values of a,b,c </li></ul><ul><li>Step:3 Find the value of D Using the Formula, </li></ul><ul><li>D = b*b-4*a*c </li></ul><ul><li>Step:4 If D is greater than or equal to zero find 2 </li></ul><ul><li>roots </li></ul><ul><li>root1  (-b+sqrt(D))/(2*a) </li></ul><ul><li>root2  (-b-sqrt(D))/(2*a) </li></ul><ul><li>Step:5 Print root1 & root2 </li></ul><ul><li>Step:6 If D is less than zero, then print the roots are imaginary </li></ul><ul><li>Step:7 Stop </li></ul>
  54. 55. Pseudocode <ul><li>Set root1,root2 </li></ul><ul><li>READ the value of a, b, c </li></ul><ul><li>Find D  b*b-4*a*c </li></ul><ul><li>IF D>=0 THEN </li></ul><ul><li>calculate root1=(-b+sqrt(D))/(2*a) </li></ul><ul><li> root2=(-b-sqrt(D))/(2*a) </li></ul><ul><li>ELSE </li></ul><ul><li>Roots are imaginary </li></ul><ul><li>END IF </li></ul><ul><li>WRITE root1,root2 </li></ul><ul><li>Stop </li></ul>
  55. 56. Flow chart Start Stop D=b*b-4*a*c Root1=[-b+sqrt(D)]/(2*a) Root2=[-b+sqrt(D)]/(2*a) Read a,b,c Print root1,root2 If D>=0 no yes Print roots are imaginary
  56. 58. Swapping two variables <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of a, b </li></ul><ul><li>Step3: c = a </li></ul><ul><li> a = b </li></ul><ul><li> b = c </li></ul><ul><li>Step4: Print the value of a and b </li></ul><ul><li>Step5: Stop </li></ul>
  57. 59. Pseudocode <ul><li>READ the value of a, b </li></ul><ul><li>To swap use </li></ul><ul><ul><ul><li>c = a </li></ul></ul></ul><ul><ul><ul><li>a = b </li></ul></ul></ul><ul><ul><ul><li>b = c </li></ul></ul></ul><ul><li>WRITE a, b </li></ul><ul><li>stop </li></ul>
  58. 60. Flowchart START c = a a = b b = c Print a, b Read a, b STOP
  59. 61. Swapping two variables without using another variable <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of a, b </li></ul><ul><li>Step3: a = a + b </li></ul><ul><li> b = a - b </li></ul><ul><li> a = a - b </li></ul><ul><li>Step4: Print the value of a and b </li></ul><ul><li>Step5: Stop </li></ul>
  60. 62. Pseudocode <ul><li>READ the value of a, b </li></ul><ul><li>To swap use </li></ul><ul><li> a = a + b </li></ul><ul><li> b = a - b </li></ul><ul><li> a = a - b </li></ul><ul><li>WRITE a, b </li></ul><ul><li>stop </li></ul>
  61. 63. Flowchart START a = a + b b = a - b a = a - b Print a, b Read a, b STOP
  62. 64. Finding the year is leap year or not <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of year </li></ul><ul><li>Step3: IF year % 4 ==0 THEN </li></ul><ul><li> print It is a Leap year </li></ul><ul><li> ELSE </li></ul><ul><li>print It is not a Leap year </li></ul><ul><li>Step4: Stop </li></ul>
  63. 65. Pseudocode <ul><li>READ year </li></ul><ul><li>IF year % 4 ==0 THEN </li></ul><ul><li>WRITE It is a Leap year </li></ul><ul><li>ELSE </li></ul><ul><li>WRITE It is not a Leap year </li></ul><ul><li>ENDIF </li></ul><ul><li>stop </li></ul>
  64. 66. Flowchart Start Read year year % 4 ==0 Print It is a Leap year Print It is not a Leap year Stop no yes
  65. 67. Finding the Factorial <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set i =1 </li></ul><ul><li>Step3: While i <= n do </li></ul><ul><li> fact =fact * i </li></ul><ul><li> i = i + 1 </li></ul><ul><li> else Goto step5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: print the value of fact </li></ul><ul><li>Step6: Stop </li></ul>
  66. 68. Pseudocode <ul><li>READ the value of n and set i =1 </li></ul><ul><li>WHILE (i <= n) do </li></ul><ul><li> fact =fact * i </li></ul><ul><li> i = i + 1 </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>WRITE fact </li></ul><ul><li>stop </li></ul>
  67. 69. Flowchart Start Read n i = 1 fact=fact * i i=i+1 Print fact while i<=n stop no yes
  68. 70. Finding the Sum of the digits <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set i = 0, sum = 0 </li></ul><ul><li>Step3: While n>0 do </li></ul><ul><li>r=n%10 </li></ul><ul><li>sum=sum + r </li></ul><ul><li>n=n/10 </li></ul><ul><li> else Goto step5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: print the value of sum </li></ul><ul><li>Step6: Stop </li></ul>
  69. 71. Pseudocode <ul><li>READ the value of n and set i =0, sum=0 </li></ul><ul><li>WHILE (n>0) do </li></ul><ul><li> r=n%10 </li></ul><ul><li> sum=sum + r </li></ul><ul><li> n=n/10 </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>WRITE sum </li></ul><ul><li>stop </li></ul>
  70. 72. Flowchart Start r = 0,sum=0 r=n%10 sum=sum + r n=n/10 Print sum while n>0 stop no yes Read n
  71. 73. Finding the Reverse of a Number <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set i = 0, sum = 0 </li></ul><ul><li>Step3: While n>0 do </li></ul><ul><li>r=n%10 </li></ul><ul><li>sum=sum *10 + r </li></ul><ul><li>n=n/10 </li></ul><ul><li> else Goto step5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: print the value of sum </li></ul><ul><li>Step6: Stop </li></ul>
  72. 74. Pseudocode <ul><li>READ the value of n and set i =0, sum=0 </li></ul><ul><li>WHILE (n>0) do </li></ul><ul><li> r=n%10 </li></ul><ul><li> sum=sum *10 + r </li></ul><ul><li> n=n/10 </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>WRITE sum </li></ul><ul><li>stop </li></ul>
  73. 75. Flowchart Start r = 0,sum=0 r=n%10 sum=sum *10 + r n=n/10 Print sum while n>0 stop no yes Read n
  74. 76. Armstrong Number <ul><li>Example: 153 </li></ul><ul><li>1 3 +5 3 + 3 3 =153 </li></ul>
  75. 77. Finding an Armstrong Number <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set a = n, sum = 0 </li></ul><ul><li>Step3: While n>0 do </li></ul><ul><li>r=n%10 </li></ul><ul><li>sum=sum + r*r*r </li></ul><ul><li>n=n/10 </li></ul><ul><li> else Goto step5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: If a = sum then </li></ul><ul><li>Print Armstrong Number </li></ul><ul><li> Else </li></ul><ul><li>Print It is Not an Armstrong Number </li></ul><ul><li> Endif </li></ul><ul><li>Step6: Stop </li></ul>
  76. 78. Pseudocode <ul><li>READ the value of n and set a =n, sum=0 </li></ul><ul><li>WHILE (n>0) do </li></ul><ul><li> r=n%10 </li></ul><ul><li> sum=sum + r*r*r </li></ul><ul><li> n=n/10 </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>IF a=sum THEN </li></ul><ul><li>WRITE Armstrong Number </li></ul><ul><li>ELSE </li></ul><ul><li>WRITE It is not an Armstrong Number </li></ul><ul><li>ENDIF </li></ul><ul><li>stop </li></ul>
  77. 79. Flowchart Start a = n,sum=0 r=n%10 sum=sum + r*r*r n=n/10 Print Armstrong No while n>0 stop no yes Read n if a=sum Print It is Not an Armstrong No
  78. 80. Fibonacci series <ul><li>Example: </li></ul><ul><li>0 1 1 2 3 5 8 11…. </li></ul>
  79. 81. Finding the Fibonacci series <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set f=0,f1=-1, f2=1 </li></ul><ul><li>Step3: While (f<n) do </li></ul><ul><li> f=f1+f2 </li></ul><ul><li> f1=f2 </li></ul><ul><li> f2=f </li></ul><ul><li> Print f </li></ul><ul><li> else Goto step5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: Stop </li></ul>
  80. 82. Pseudocode <ul><li>READ the value of n and set f=0 ,f1=-1, f2=1 </li></ul><ul><li>WHILE (f<n) do </li></ul><ul><li> f=f1+f2 </li></ul><ul><li> f1=f2 </li></ul><ul><li> f2=f </li></ul><ul><li>WRITE f </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>stop </li></ul>
  81. 83. Flowchart Start f=0,f1= -1,f2=1 f=f1+f2 f1=f2 f2=f Print f while f<n stop no yes Read n
  82. 84. Conversion of Celsius to Fahrenheit <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of Celsius </li></ul><ul><li>Step3: Fahrenheit = (1.8* Celsius) + 32 </li></ul><ul><li>Step4: Print Fahrenheit </li></ul><ul><li>Step5: Stop </li></ul>
  83. 85. Pseudocode <ul><li>Set Fahrenheit </li></ul><ul><li>READ the Celsius </li></ul><ul><li>COMPUTE Fahrenheit = (1.8* Celsius) + 32 </li></ul><ul><li>PRINT Fahrenheit </li></ul><ul><li>stop </li></ul>
  84. 86. Flowchart START Fahrenheit = (1.8* Celsius) + 32 Print Fahrenheit Read Celsius STOP
  85. 87. Conversion of Fahrenheit to Celsius <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of Fahrenheit </li></ul><ul><li>Step3:Calculate Celsius =(Fahrenheit – 32)/1.8 </li></ul><ul><li>Step4: Print Celsius </li></ul><ul><li>Step5: Stop </li></ul>
  86. 88. Pseudocode <ul><li>Set Celsius </li></ul><ul><li>READ the Fahrenheit </li></ul><ul><li>COMPUTE Celsius =(Fahrenheit – 32)/1.8 </li></ul><ul><li>PRINT Celsius </li></ul><ul><li>stop </li></ul>
  87. 89. Flowchart START Celsius =(Fahrenheit – 32)/1.8 Print Celsius Read Fahrenheit STOP
  88. 90. Finding the sum of odd number between 1 to n <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set sum=0,i=1 </li></ul><ul><li>Step3: While (i<=n) do </li></ul><ul><li> sum=sum+i </li></ul><ul><li> i=i+2 </li></ul><ul><li> else Goto step5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: Print sum </li></ul><ul><li>Step6: Stop </li></ul>
  89. 91. Pseudocode <ul><li>READ the value of n and set sum=0,i=1 </li></ul><ul><li>WHILE (i<=n) do </li></ul><ul><li> sum=sum+i </li></ul><ul><li> i=i+2 </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>WRITE sum </li></ul><ul><li>stop </li></ul>
  90. 92. Flowchart Start sum=0,i=1 sum=sum+i i=i+2 Print sum stop Read n While i<=n
  91. 93. Finding the sum of even number between 1 to n <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set sum=0,i=0 </li></ul><ul><li>Step3: While (i<=n) do </li></ul><ul><li> sum=sum+i </li></ul><ul><li> i=i+2 </li></ul><ul><li> else Goto step 5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: Print sum </li></ul><ul><li>Step6: Stop </li></ul>
  92. 94. Pseudocode <ul><li>READ the value of n and set sum=0,i=0 </li></ul><ul><li>WHILE (i<=n) do </li></ul><ul><li> sum=sum+i </li></ul><ul><li> i=i+2 </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>WRITE sum </li></ul><ul><li>stop </li></ul>
  93. 95. Flowchart Start sum=0,i=0 sum=sum+i i=i+2 Print sum stop Read n While i<=n
  94. 96. Conversion of Binary number to Decimal <ul><li>Algorithm </li></ul><ul><li>Step1: Start </li></ul><ul><li>Step2: Read the value of n and set i = 0, sum = 0 </li></ul><ul><li>Step3: While n>0 do </li></ul><ul><li>r=n%10 </li></ul><ul><li>sum=sum + r*pow(2,i) </li></ul><ul><li>n=n/10 </li></ul><ul><li>i=i+1 </li></ul><ul><li> else Goto step5 </li></ul><ul><li>Step4: Goto step 3 </li></ul><ul><li>Step5: print the value of sum </li></ul><ul><li>Step6: Stop </li></ul>
  95. 97. Pseudocode <ul><li>READ the value of n and set i =0, sum=0 </li></ul><ul><li>WHILE (n>0) do </li></ul><ul><li> r=n%10 </li></ul><ul><li> sum=sum + r*pow(2,i) </li></ul><ul><li> n=n/10 </li></ul><ul><li> i=i+1 </li></ul><ul><li>ENDWHILE </li></ul><ul><li>Repeat the loop until condition fails </li></ul><ul><li>WRITE sum </li></ul><ul><li>stop </li></ul>
  96. 98. Flowchart Start sum=0,i=0 Print sum stop Read n While n>0 r=n%10 sum=sum + r*Pow(2,i) n=n/10 i=i+1
  97. 99. Application software Packages
  98. 100. Application software <ul><li>Set of programs, which is used to perform some specific task. </li></ul><ul><li>Example: </li></ul><ul><ul><ul><li>Word processor </li></ul></ul></ul><ul><ul><ul><li>Spreadsheet program </li></ul></ul></ul><ul><ul><ul><li>Database program etc,. </li></ul></ul></ul>
  99. 101. MS-Word <ul><li>Starting MS-Word </li></ul><ul><li>Start  All Programs  Microsoft Office  Microsoft Office Word </li></ul>
  100. 102. <ul><li>Creating a New Document </li></ul><ul><li>File  New (or) ctrl+N </li></ul><ul><li>(or) clicking the new button </li></ul><ul><li>Opening a Document </li></ul><ul><li>File  Open (or) ctrl+O </li></ul><ul><li>(or) clicking the open button </li></ul>
  101. 103. <ul><li>Saving a New Document </li></ul><ul><li>File  Save (or) ctrl+S </li></ul><ul><li>(or) clicking the save button </li></ul><ul><li>Printing a Document </li></ul><ul><li>File  Print (or) ctrl+P </li></ul><ul><li>(or) clicking the open button </li></ul>
  102. 104. <ul><li>Moving the Text </li></ul><ul><li>Ctrl+X </li></ul><ul><li>(or) clicking the cut button </li></ul><ul><li>Copying the Text </li></ul><ul><li>Ctrl+P </li></ul><ul><li>(or) clicking the copy button </li></ul>
  103. 105. Find and Replace <ul><li>Find & Replace </li></ul><ul><li>Edit  Find and Replace (or) Ctrl+F </li></ul>
  104. 106. Formatting the Document <ul><li>Format Menu ( Format  Font) </li></ul><ul><ul><li>Font size, type, colour, Subscript, Superscript, Spacing,Text Effects etc,. </li></ul></ul><ul><ul><li>Bullets and Numberings </li></ul></ul><ul><ul><li>Changing case </li></ul></ul><ul><ul><li>Borders and Shadings etc,. </li></ul></ul>

×