1 / 31

Introduction To Programming Information Technology , 1’ st Semester

MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE. Using Java. Introduction To Programming Information Technology , 1’ st Semester. Lecture 2 : How To Build applications?. Teacher: Mahmoud Rafeek Alfarra. Notations. HW 1.1. Home Work.

hwatson
Télécharger la présentation

Introduction To Programming Information Technology , 1’ st Semester

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Using Java Introduction To ProgrammingInformation Technology , 1’st Semester Lecture 2 : How To Build applications? Teacher: Mahmoud Rafeek Alfarra

  2. Notations HW 1.1 Home Work Be Care Very Important information Presented & Prepared by: Mahmoud R. Alfarra

  3. Outline • Programming Life Cycle … • Algorithms • Pseudo Code • Flow Chart • Practices • Emank X Mezank Presented & Prepared by: Mahmoud R. Alfarra

  4. Programming Life Cycle • Building an application has five sorted stages: • Thinking • Planning • Designing • Coding • Testing Presented & Prepared by: Mahmoud R. Alfarra

  5. Thinking Stage • Thinking Stage is the most important one in the life cycle of programming because its result has an occur affect on the following stages. • No rules • No specific language • Only read, understand, imagine Presented & Prepared by: Mahmoud R. Alfarra

  6. Planning Stage • Before writing a program to solve a problem, it is essential to have a thorough understanding of the problem and a carefully planned approach to solving it. • We have many techniques to represent our approach before designing and coding it(Algorithm). • Pseudo Code • Flow Chart Presented & Prepared by: Mahmoud R. Alfarra

  7. Designing Stage • Designing stage focuses on how the application will be appeared to users. Presented & Prepared by: Mahmoud R. Alfarra

  8. Coding stage • In this stage, we translate all of the previous stages to a specific programming language. NO yes If (x>=0) Fx = x; else Fx = -x; X <=0 F(x) =- X F(x) = X Presented & Prepared by: Mahmoud R. Alfarra

  9. Testing stage • In This stage, the programmer test his application by inputting many values and compare the results with the supposed one. • If they are not the same … the programmer must repair his application. Presented & Prepared by: Mahmoud R. Alfarra

  10. What are the algorithms? • Any computing problem can be solved by executing a series of actions in a specific order. • An algorithm is a procedure for solving a problem in terms of • The actions to execute and • The order in which these actions execute. HW 2.1 In two pages, write what is algorithm, why and how do they represented ? Presented & Prepared by: Mahmoud R. Alfarra

  11. What are Algorithms? • Specifying the order in which statements (actions) execute in a program is called program control. • Program control can be one of three structures : • Sequential structure • Selection structure • Repetition structure Presented & Prepared by: Mahmoud R. Alfarra

  12. Why Algorithms? • Documented my solution ideas • Detect the time and space of the solution. • Help the programmer to determine the logical errors. • Comparing between solutions of the same problem. Presented & Prepared by: Mahmoud R. Alfarra

  13. How to represent Algorithms? • To represent algorithms we have two ways: Algorithms representation Pseudo code Flow Chart Presented & Prepared by: Mahmoud R. Alfarra

  14. Pseudo code • Pseudocode is an informal language that helps programmers develop algorithms without having to worry about the strict details of Programming language syntax. • Pseudocode is similar to everyday English. • But it is not an actual computer programming language. Presented & Prepared by: Mahmoud R. Alfarra

  15. Pseudo code • Pseudocode normally describes only statements representing the actions of the solution. • Such actions might include input, output or a calculation. If student's grade is greater than or equal to 60 Print "passed" else Print "failed" Presented & Prepared by: Mahmoud R. Alfarra

  16. Flow Chart • Flow Chart is a way to illustrate the step of solving the problems using shapes. • Every pseudo code can be represented by Flow chart. HW 2.2 In one page, discuss the meaning of Flowchart and its importance? Presented & Prepared by: Mahmoud R. Alfarra

  17. Flow Chart Shapes To represent the start and end of the program To represent the input and Output process To represent the arithmetic operations Presented & Prepared by: Mahmoud R. Alfarra

  18. Flow Chart Shapes To represent logical operators And conditions as (if (x >5)) To represent the flow of the operations Presented & Prepared by: Mahmoud R. Alfarra

  19. Think & Solve Practices Presented & Prepared by: Mahmoud R. Alfarra

  20. Practice 1.1 Write Algorithm… • Write the algorithm to print the average of the temperatures T1, T2, T3. Read the T1, T2, T3 Calculate the sum by: sum = T1, T2, T3 Calculate the average by : average = sum/3 Print average Be Care: when the question ask about an algorithm, you can write pseudo code or Flow chart, its yours Presented & Prepared by: Mahmoud R. Alfarra

  21. Practice 1.1 Write Algorithm… Start Read T1, T2, T3 • This control structure is a Sequential Structure. That the statements in a program are executed one after the other in the order in which they are written. Sum = T1+T2+T3 Average = sum/3 Print Average End Presented & Prepared by: Mahmoud R. Alfarra

  22. Practice 1.2 Write Flow chart… • Write the algorithm to calculate the average of the temperatures T1, T2, T3 and print (cold)if it less than 17 and print (hot) if it greater or equal to 17. Be Care: When the question ask about a specific representation way, you MUSTsolve with this way. Presented & Prepared by: Mahmoud R. Alfarra

  23. Practice 1.2 Write Flow chart… Start Read T1, T2, T3 • This control structure is a selection structure That the statements in a program are executed one after the other in the order in which they are written. Sum = T1+T2+T3 Avg = sum/3 No Yes Avg >= 17 Print Cold Print Hot End Presented & Prepared by: Mahmoud R. Alfarra

  24. Practice 1.3 Write Algorithm… • Write an algorithm to Print the area of a circle,( area = π * R2 ). Read the R Set π = 3.14 Calculate the area by: area =π * R *R Print area • Arithmetic equation In algorithms, must be simplified (i.e: X2= X*X) , (2X = 2*X), (2+3X = 2+ 3*x) etc. Presented & Prepared by: Mahmoud R. Alfarra

  25. Practice 1.3 Write Algorithm… start Read R π = 3.14 Rewrite this practice, to calculate the around of circle and Print (Max) if it is greater than 40 and print (Min) if it is less than or equal to 40 area = π × R × R Print area HW 2.3 End Presented & Prepared by: Mahmoud R. Alfarra

  26. Practice 1.4 Write Algorithm… • Write an algorithm to accept an integer from the user and then print it multiple table from (1 to 12)… Read the X Set counter to 1 While counter less than or equal to 12 Repeat Print X * counter Set counter = counter +1 Presented & Prepared by: Mahmoud R. Alfarra

  27. Practice 1.4 Write Algorithm… Start Read X Counter = 1 No Counter <=12 Yes Print (counter *X) Counter = counter +1 Presented & Prepared by: Mahmoud R. Alfarra End

  28. Now … Try the Following • Write an algorithm to calculate the value of the F(x) function. • Write an algorithm to accept three integers from the users and print the maximum one. • Write an algorithm to print the average of population of Gaza. Presented & Prepared by: Mahmoud R. Alfarra

  29. Now … Try the Following • Write an algorithm to calculate how many IT student success in the Programming 1 course. Consider all of the previous practices as home work HW 2.4 Presented & Prepared by: Mahmoud R. Alfarra

  30. Emank X Mezank عَنْ أَبِي أُمَامَةَ رَضِيَ الله عَنْهُ، عَنْ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ، قَالَ : (إِنَّ صَاحِبَ الشِّمَالِ لِيَرْفَعُ الْقَلَمَ سِتَّ سَاعَاتٍ عَنِ الْعَبْدِ الْمُسْلِمِ الْمُخْطِئِ أَوِ الْمُسِيءِ، فَإِنْ نَدِمَ وَاسْتَغْفَرَ اللَّهَ مِنْهَا أَلْقَاهَا، وَإِلا كُتِبَتْ وَاحِدَةً) حسنـه الألباني Presented & Prepared by: Mahmoud R. Alfarra

  31. Next… Main concepts of Programming Presented & Prepared by: Mahmoud R. Alfarra

More Related