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

Slides:



Advertisements
Similar presentations
C Programming Technique – Firdaus-Harun.com
Advertisements

ALGORITHMS AND FLOWCHARTS
More on Algorithms and Problem Solving
Exercise (1).
PROBLEM SOLVING TECHNIQUES
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
 Control structures  Algorithm & flowchart  If statements  While statements.
Chapter 2- Visual Basic Schneider
Introduction to Computers and Programming Lecture 5 New York University.
Introduction to Computers and Programming Lecture 5 Boolean type; if statement Professor: Evan Korth New York University.
Program Flow Charting How to tackle the beginning stage a program design.
CHAPTER 4: ALGORITHM 4.1 Introduction stages identified in the program development process: 1. Problem analysis and specification 2. Data organization.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Fundamentals of C programming
ALGORITHMS AND FLOWCHARTS
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Programming Lifecycle
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Structural Program Development: If, If-Else Outline.
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Lecture 7 Decision Making : selection statements.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Structured Program Development Outline 2.1Introduction 2.2Algorithms 2.3Pseudo code 2.4Control Structures 2.5The If Selection Structure 2.6The If/Else.
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Software Life Cycle What Requirements Gathering, Problem definition
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Chapter 2: General Problem Solving Concepts
Dale Roberts 1 Program Control - Algorithms Department of Computer and Information Science, School of Science, IUPUI CSCI N305.
Chapter 3 - Structured Program Development Outline 3.1Introduction 3.2Algorithms 3.3Pseudocode 3.4Control Structures 3.5The If Selection Structure 3.6The.
1 Program Planning and Design Important stages before actual program is written.
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Lecture 9 & 10 Repetition Statements.
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Lecture 15,16 Java’s Methods.
CS2301:Computer Programming 2
The Hashemite University Computer Engineering Department
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Lecture 18 Recursion & Pointers in Java.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
 Problem Analysis  Coding  Debugging  Testing.
Program design Program Design Process has 2 phases:
Programming Languages
Presented By: Mahmoud Rafeek Alfarra
Chapter 2- Visual Basic Schneider
ALGORITHMS AND FLOWCHARTS
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
Algorithms and Flowcharts
Introduction to Algorithm – part 1
ALGORITHMS AND FLOWCHARTS
Introduction To Programming Information Technology , 1’st Semester
Algorithms & Pseudocode
Structured Program
1) C program development 2) Selection structure
ALGORITHMS AND FLOWCHARTS
Introduction To Programming Information Technology , 1’st Semester
Chapter 2- Visual Basic Schneider
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Introduction To Programming Information Technology , 1’st Semester
Introduction To Programming Information Technology , 1’st Semester
WJEC GCSE Computer Science
Structural Program Development: If, If-Else
Presentation transcript:

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

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

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

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

 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

 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

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

 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;

 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

 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

 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

 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

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

 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

 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"

 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 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 Presented & Prepared by: Mahmoud R. Alfarra To represent logical operators And conditions as (if (x >5)) To represent the flow of the operations

19 Presented & Prepared by: Mahmoud R. Alfarra Practices

 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 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.

 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 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 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.

 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 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

 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 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

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

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

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