Advanced Programming Java 1


Vishal

Uploaded on Jul 22, 2019

Comments

                     

Advanced Programming Java 1

Advance Programming Java Lecture 1 Assoc. Prof. Dr. Wael Yafooz ASSESSMENT  Quizzes 1,2 3 (15%)  Project (10%)  Participation (5%)  Mid-term (20%)  Final Exam (50 %) OUTLINE  Programming Methodology  Why Java  Compiler and interpreter  Java Virtual Machine  Operators  Loops  If statement  Switch Statement PROBLEM SOLVING  Before writing a program for certain problem we need first to solve this problem. Different techniques are proposed to find the solution of the problem, for example: 1. Algorithms. 2. Refinement of the Algorithm. 3. Top-Down Design. PROBLEM SOLVING Algorithm is a finite set of steps/instructions for solving a problem in a finite amount of time.  In order to write an algorithm we need to define three components: 1. The input of the problem. 2. The output of the problem. 3. Processing - a list of steps that are performed on the input to produce the output. PROBLEM SOLVING  Refinement of the algorithm means that refine each step in the algorithm by replacing it with more detailed steps. PROBLEM SOLVING  The top-down design is the process of dividing a large problem into many small subproblems.  The steps of top-down design are as follows. 1. Divide the problem into subproblems. 2. Each subproblems is divide into smaller subproblems many times until each subproblem can be solved easily. 3. Find the solution of each subproblem. 4. Combine the solution of all subproblems to obtain the solution of the original problem. PROGRAMMING METHODOLOGIES  Programming methodology is a way of conceptualizing what it means to perform computation. 1. Structured Programming (SP): using the three basic control structures: sequential (an ordered execution of statements), selective (if-else, switch), and repetition (for, while, do-while). 2. Procedural Programming (PP): using a collection of variables, data structures and subroutines (procedure and function). 3. Object Oriented Programming (OOP): using objects – data and methods together with their interactions. 8 PROGRAMMING METHODOLOGIES #include #include void mian() long factorial(unsigned int n) { unsigned int n; // positiveS P { long f=1; PP integer for (int i=1; i