Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computer Programming

Similar presentations


Presentation on theme: "Introduction to Computer Programming"— Presentation transcript:

1 Introduction to Computer Programming
ISM 3005 Course Introduction Introduction to Computer Programming Exercise #1 Exercise #2 6 Program Development Steps Program Design as an Art Typical Beginner Problems Six Computer Operations Summary Demonstration 2

2 Computers & Organizations
The first rule of any technology used in a business is that automation applied to an efficient operation will magnify the efficiency. The second rule is that automation applied to an inefficient operation will magnify the inefficiency. Bill Gates

3 Exercise #1 (Who’s The Dummy Now?)

4 Exercise #2

5 Exercise (cont.) Were you correct (would your instructions have given a correct answer)? If not, why? Didn’t know a step? Forgot to include a step? You thought you knew the steps but were wrong? Calculations were wrong? This part of programming is where the majority of problems occur… … but it has nothing to do with computers or code

6 Six Program Development Steps
Analyze: Define the problem Design: Plan a solution Choose the Interface: What will the user see and do? Code: Translate the solution into programming language Test and Debug the Program: Find program and logic errors Complete the Documentation: Finish what you should have been working on all along

7 Defining the Problem Ensuring that the programmer is working on the correct problem Users notorious for not clearly stating the problem to be solved or desired results Ensuring that the programmer understands the problem itself Domain-specific knowledge need for the solution User-specific terminology Avoid wasting time on false starts or the wrong problem

8 Defining the Problem: Example
The instructor’s policy is to adjust each person’s score upward so that the highest score becomes 100 and all other scores are adjusted to be their percentage of the high score. Grades are currently stored in a sequential data file with the student’s SSN followed by their raw score followed by the next student’s SSN . . . What is your task? Is it clearly stated? Can you infer it? What is the formula for each student’s adjusted score?

9 Design Identifying the major steps in the solution Where will data be and how will it be structured? Which screens will be needed and what will they do? What information must the user provide? What processing must the computer do and in what sequence? What outputs must the program create? Design is the most fundamentally important step in system creation (and the one that pays the best)

10 Design (cont.) Use an Input - Processing - Output model approach What is the output of the program? What inputs are available or needed? What processing will transform the inputs into the outputs? Avoid getting bogged down in details (until later) Outline the solution as if pencil, paper, and 3x5 index cards are the only tools available Don’t start programming until you understand what you are trying to accomplish!

11 Design: Example The solution will have three major steps which must be accomplished in order 1 Read the file to find the highest score 2 Calculate the amount of the curve 3 Update each record by performing the calculation on it and saving the score Each of these steps will have further specific sub- steps to be accomplished How would you do this if all scores were on 3x5 cards?

12 Choose the Interface The interface is the way the program looks to the user Focus on the tasks as the user perceives them Give each logical step in the process its own portion of the interface Screen Section of a screen

13 Choose the Interface (cont.)
What interface elements would be needed for our sample problem? What interface elements would be needed if we expand the scope of the problem to include data collection as well as final grade calculation?

14 Code the Solution Translate the solution design into specific code Programming (as opposed to design) is primarily a process of putting familiar elements into a different order Like constructing a new paragraph with old words Recognize the program elements identified in the design step Recognize the programming elements available in the language Match the programming elements with the design needs and modify for the circumstances

15 Test and Debug Test the program for several factors Language errors Logic errors Use test data with known results Compare computer results with test results Run-time errors—Errors that occur with certain combinations of data Test the extreme values First and last elements Highest and lowest possible values Anything a user could possibly do

16 Test and Debug (cont.) Test and debug small chunks of code Save and then run your program regularly (Rule of thumb: after every five lines or so) If the program worked Then you write five lines of code Now it doesn’t work Where do you think the problem is?

17 Complete the Documentation
Documentation must take place at every step in the process Database design Solution development Algorithm development Coding Document as you GO! Don’t wait until you are finished Document your design in your code Documentation will be very heavily weighted in this course

18 Program Design as an Art
Most of the previous steps require analysis Steps will not be implemented as rules that apply in every case Programmer brings experience with patterns of program flow and structure to bear on new problems Introducing these patterns is a major objective of this course

19 Program Design as an Art (cont.)
Programmer must have the ability to communicate Programmer must be able to recognize when a language capability is applicable to an algorithm need There is often more than one correct answer!!

20 Typical Beginner Problems
You cannot look for the correct answer to your programming challenge in a reference Each problem is new (or we’d use the existing solution) You must figure out the solution to the problem before you start coding! You must decompose big problems into steps Repeat until there are nothing but little problems Then solve the little problems Learn the mechanics of managing your project files. Practice them and back up your files!!

21 Six Computer Operations
Computers can perform six fundamental tasks Receive information from various sources Output information in various ways Print or screen Permanent storage Perform arithmetic Assign values to variables (temporary storage) Make choices based on compared values Repeat (iterate) actions Programs are constructed by building code segments around these capabilities

22 Six Computer Operations (cont.)
Programming languages provide built in capabilities to accomplish the six operations Often more than one way to do each These are the tools in your toolbox You must learn how to use them and when to use them And don’t forget your focus on the underlying problem Focus on the details (the trees) Don’t forget the forrest

23 PRACTICE Summary You will deal heavily with Patterns Implications
Values The exact answer is rarely in the book Imagination, creativity, and experience are key This class helps with experience Imagination and creative are in your arena PRACTICE


Download ppt "Introduction to Computer Programming"

Similar presentations


Ads by Google