Programming 1 Unit 2 Vocabulary

Ace your homework & exams now with Quizwiz!

The Programming Process

A computer program is a list of instructions that contain data for a computer to follow. Different programs are written with different languages. A five step programming process is outlined in this section. Identify the Problem Design the Solution Write the Program Test the Program Document and Maintain the Program

Structured Programming

A technique that has proven to be very effective in solving programs as well as in modifying solutions. The principles of structured programming are fundamental to procedure-oriented programming. They are also relevant to object-oriented programming. Structured programming is the ability to express a problem solution using only three basic patterns of logic. These patterns are referred to as control structures. The patterns are based on the computer's ability to execute instructions in a step-by-step, sequential manner; its ability to make decisions; and its ability to repeat instructions. "Structure theorem" (paper by C. Bohm and G. Jacopini in 1965) - accepted as a proof of the claim that the three structures are sufficient for programming.

Flowchart

A third tool in programming is through the use of a flowchart. Flowcharts use symbols and text to give a visual representation of a solution to a problem. The direction of the arrows indicates the flow of the logic. Flowcharts help the programmer begin to plan the programming project. They provide a visual representation of the algorithm or process. They describe the inputs, processes and outputs of the program that are needed to successfully complete the project. Ovals : Start should always be the first shape, with a End at the end of the flow chart or a process. Parallelogram: This shape is used to show raw materials used for 'ingredients' and to show the finished product. Input/Output - Get/Display Rectangles should be used to show processes/commands, eg. 'Bake Cake'. These are activities. Diamonds: Hold questions that resolve into True or False. Used for decisions that divide into two options and to control loops.

Algorithms

An algorithm is a list of steps to solve a problem written in plain English. Steps to solve a problem are written out and numbered in the order in which they should be executed. They should be as extensive as necessary to outline the solution. Your algorithm is not only going to tell your program what to do but how to do it.

Complexity

As a program become more complex documentation becomes more important. A program might be 100,000 lines of code. How would you remember what every single line does? Windows for example is 40,000,000 lines of code!

Use Cases

Define the interactions between the "actor" and the system. Actor = class of users, roles users play, or other systems. In other words, the actor is any user of the system. The Use Case describes the sequence of steps between the actor (user) and the system necessary to complete a goal.

Functional Requirements

Functional requirements are the functions that the software/system is intended to perform. what the software should do (behaviors) given conditions.

Comments

In programming documenting your code is referred to as commenting. Comments can be on their own line or after a line of code. Comments begin with a ' . Comments will turn the text green.

Problem Solving Tools

Programs are created to solve problems. A solution must be designed prior to coding. One method of designing a solution to a problem is to create an algorithm.

Pseudocode

Pseudocode is a mix of English language and code that represents what you want your program to do. It helps you determine how you want the program to work as well as what variables and methods/functions you will want to include. Developing pseudocode will help you work through your logic, reducing the number of errors and potential re-writes you will have to do.

SIMPLE SEQUENCE Control Structure

Represents the computer's ability to execute instructions in a step-by-step, sequential manner. Example: directions to get to the school - steps must be followed sequentially

Conditional Control Structure

Represents the computer's ability to make a decision Example: provide alternate directions if there is a blocked intersection.

Iteration Control Structure

Represents the computer's ability to repeat a series of instructions Loop - a series of repeated instructions Infinite loop - instructions that would continue without a way out. Every loop must include a statement that defines how many times to execute the loop steps or under what condition to continue or stop the looping process.

Basic Control Structures

Three patterns: Simple Sequence control structure Conditional control structure Decision Iteration control structure Loops

Documentation

Why is it important? Without proper documentation programs do not make sense, especially if you return to them later. Or worse yet, you inherit a program from someone else and have to figure out what it does!


Related study sets

Chapter 16 Practice Problems (Solutions)

View Set

Pharmacology for Nurses: A Pathophysiologic Approach, Ch. 26: Drugs for Hypertension

View Set

Combo with "Real Estate - Ch#6 - Transferring and Recording Title to Real Estate" and 2 others

View Set

Business Stats Chapter Five Probability

View Set

Chapter 9 - Texas Government Vocabulary

View Set