Download presentation
Presentation is loading. Please wait.
Published byPhyllis Reeves Modified over 8 years ago
1
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Management Information System Section (211 NMA course) Introduction to Programming
2
جامعة المجمعة كلية العلوم والدراسات الإنسانية بالغاط قسم نظم المعلومات الإدارية مقرر 211 نما مقدمة في البرمجة
3
Chapter 1 An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development Cycle 1.4 Programming Tools 3
4
Review Four Stages in a program Read Input Validate Input Process Input Output Result An Algorithm is… A step-by-step procedure devised for the purpose of taking in data and producing the correct output. What’s the difference between an algorithm and a program? A program is the actual implementation of an algorithm in a programming language. 4
5
Review When Developing a program in both the real world AND in this class, there are 6 steps 1)Analyze the problem 2)Plan a solution 3)Design an interface 4)Write the code 5)Test and debug 6)Document the program 7)Maintain the program 5
6
Program development cycle 1. Analyze: Define the problem. 2. Design: Plan the solution to the problem. 3. Choose the interface: Select the objects (text boxes, buttons, etc.). 6
7
Program development cycle continued 4. Code: Translate the algorithm into a programming language. 5. Test and debug: Locate and remove any errors in the program. 6. Complete the documentation: Organize all the materials that describe the program. 7
8
Program Planning Tips Always have a plan before trying to write a program The more complicated the problem, the more complex the plan must be Planning and testing before coding saves time coding 8
9
Program Planning A recipe is a good example of a plan Ingredients and amounts are determined by what you want to bake Ingredients are input The way you combine them is the processing What is baked is the output 9
10
Performing a Task on the Computer Determine Output Identify Input Determine process necessary to turn given Input into desired Output 10
11
Problem-solving: approach like algebra class How fast is a car traveling if it goes 50 miles in 2 hours? Output: a number giving the speed in miles per hour Input: the distance and time the car has traveled Process: speed = distance / time 11
12
Pictorial representation of the problem solving process 12
13
Review An End User is… – The person whom the program was designed for. A User-Interface is… – How the user interacts with your program. Documentation is… – Organizing all the material that describes the program. Three models used to help develop an algorithm: – Flow Charts – Hierarchy Charts – Pseudocode 13
14
Mouse Actions: – Hover – Drag and drop – Click – Right-click – Double-Click 14
15
Programming Layer Model Many event-driven programs can be divided into three important sections or layers: – Presentation Layer – Anything the user sees and how the user interacts with a program. – Logic Layer – How the program acts when it receives events. – Data Access Layer – Allows simple access to persistent storage (like a database). We probably won’t be doing this in this course. It is important to separate the layers from each other as much as possible. – Why? 15
16
Programming Layer Model 16 Presentation Layer Logic Layer Data Access Layer DB
17
Flowchart It is a graphical way to describe the solution of the problem. 17 Flow Chart Symbols Start and End Input / output Selection Calculation Data Flow
18
Problem : Compute and print the summation of two numbers. 18 Input a,b S = a + b Output s
19
Problem : Compute and print the average of three numbers. 19 Input n1,n2,n3 S = n1+n2+n3 Average = s / 3 Output average
20
Problem : Compute the area of the circle. Where area = 3.14 x R2 20 Input r A = 3.14 * R *R Output A
21
Problem : Read Two numbers from the user, then print the greatest one. 21 Input x, y Output x X>y TrueFalse Output y
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.