Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.

Similar presentations


Presentation on theme: "Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE."— Presentation transcript:

1 Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE

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

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

4  Building an application has five sorted stages:  Thinking  Planning  Designing  Coding  Testing 4 Presented & Prepared by: Mahmoud R. Alfarra

5  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 5 Presented & Prepared by: Mahmoud R. Alfarra

6  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 6 Presented & Prepared by: Mahmoud R. Alfarra

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

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

9  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. 9 Presented & Prepared by: Mahmoud R. Alfarra

10  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. 10 Presented & Prepared by: Mahmoud R. Alfarra In two pages, write what is algorithm, why and how do they represented ? HW 2.1

11  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 11 Presented & Prepared by: Mahmoud R. Alfarra

12  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. 12 Presented & Prepared by: Mahmoud R. Alfarra

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

14  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. 14 Presented & Prepared by: Mahmoud R. Alfarra

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

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

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

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

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

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

21 21 Presented & Prepared by: Mahmoud R. Alfarra Practice 1.1 Sum = T1+T2+T3 Start Read T1, T2, T3 Average = sum/3 Print Average End Sequential Structure 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.

22  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. 22 Presented & Prepared by: Mahmoud R. Alfarra Practice 1.2 Be Care MUST Be Care: When the question ask about a specific representation way, you MUST solve with this way.

23 23 Presented & Prepared by: Mahmoud R. Alfarra Practice 1.2 Sum = T1+T2+T3 Start Read T1, T2, T3 Avg = sum/3 Print Hot Avg >= 17 Print Cold End YesNo selection structure 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.

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

25 25 Presented & Prepared by: Mahmoud R. Alfarra Practice 1.3 π = 3.14 start Read R area = π × R × R Print area End around of circle 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 HW 2.3

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

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

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

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

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

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


Download ppt "Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE."

Similar presentations


Ads by Google