Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Programming

Similar presentations

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

1 Introduction to Programming

2 Software Development Life Cycle
Gather Requirements Design Program Code & Test Program Implement Software Development has four main phases Gathering Requirements Program Design Coding & Testing the Program Implementing the Program The software development cycle is the process by which a program/application is constructed. While there are many different methodologies (e.g. waterfall), they all have the main phases above.

3 CS132 Development Life Cycle
Gather Requirements Design Program Code & Test Program Implement Get requirements document from D2L Make sure you understand the requirements Design the form layout Add code to the program to meet the requirements Test the program under several possible scenarios Submit program for grading in the D2L dropbox For INFS639, our life cycle is truncated quite a bit. You will get requirements form the book; Some even have screen designs for you. This is a little unrealistic though; that is why two designs (Sept 29 and Oct 13) to do independently. Some of the programs build on each other, so you want to make sure you keep a copy of what you give me. You will be responsible to code and test your programs before submitting. The implementation phase of the life cycle for the class is abbreviated into you handing the program in.

4 Program Design Basics A software developer must
Design the visual elements (user interface) and logical function of the program to meet the given specifications The design is language independent; could be described using flowcharts or pseudocode Implement this design by writing code that is both functional and easily understood by another programmer Think of the target audience of a program as being other programmers, not just the computer Describes a programmer’s job. I always think of a programmer as a translator. He or she must be able to translate what the user says they want into something the computer recognizes.

5 Design Tools Algorithm - finite set of unambiguous instructions, that when given a set of input values, produces the desired outputs, then stops Like a recipe Often given pseudocode, a programming language-like set of natural language instructions Flowchart - a graphical language used to communicate the logic of a program For our purposes, algorithm and pseudocode will be used interchangeably. You may also see the same process called Structured English. They all mean the same thing; a structured way to think about and design code. Flowcharts are a bit antiquated, but the concepts inherent with them is still valid. Again, flowcharts are another way to provide structure to a very unstructured process.

6 Describing an Algorithm with Pseudocode
Consider the task of making a peanut butter and jelly sandwich Given a jar of peanut, a jar of jelly, a loaf of sliced bread, and a knife: Take two bread slices from the loaf Open jelly jar; use knife to apply jelly to one slice of bread Open peanut butter jar; use knife to apply peanut butter to the other slice of bread Place the bread slices together What is left out?

7 Flowcharts An alternative, graphical way to describe a program’s design System Flowchart Program Flowchart There are two main sets of flowcharting symbols: system and program. We are going to deal with the program level in the later chapters when the logic gets a little more complex. For now, we will practice going between algorithms and flowcharts.

8 Implementing design To complete our software projects we will need to
Understand file management in Windows Access the CEAS computer labs Become familiar with the Visual Basic Integrated Development Environment (IDE) Find information using VB Help

9 The Windows File System
Double clicking on the “My Computer” icon will invoke the process shown. There are four views of the data, two are shown. Normally, only one view of the window will appear until you open sub-menus.

10 Copying Files Open two “My Computer” windows, one for the area with files in it and one for the destination area Mark file(s) in first window to be copied Click on Edit-Copy Move to other window Click on Edit-Paste

11 Single and Multiple Files
(1) Click left hand button to select one file and to deselect all others. (2) While holding down Ctrl, click to add a file to selection list. (3) While holding down Shift, click to add a range of files to selection list.

12 (Hint for Later) This business of Click, Ctrl-Click, and Shift-Click will come in very handy later when you wish to select Objects in Visual Basic (VB) for various kinds of manipulation. When you want to resize, change font, or move a group of objects, the Ctrl and Shift-Click really works to your advantage.

13 Engineering Lab Drives
The Engineering Laboratory has several drives available to you. In general they are named A, C, I, Q, R & S. A: The floppy disk drive, 3.5 inch, 1.4 (or 0.7) megabytes C: The local hard drive, belongs to the machine you are sitting in front of (the local machine). I: A part of the disk “farm”. Each of us has his own copy of drive “I” with a 40 megabyte capacity. Q, S: The software “farm”. You may execute some files, copy other but cannot change any of them. R: A part of the disk “farm” with special software for each class. R:\cs132 contains class material.

14 Engineering Lab Drives

15 I & M T Lab Drives Drive P on this system is not the same space as Drive I in the Engineering lab system.

16 Visual Basic (VB) We will be using the Engineering Laboratory to study programming in the Visual Basic Language. In the pictures that follow we will examine how that tool is installed in the Engineering Laboratory, other machines will most certainly differ.

17 Accessing Visual Basic (VB)

18 Visual Basic Files When you save a program in VB several files are created. The two that are most significant are the .frm and the .vbp files, the form and program files. Both of them are text files.

19 The File Blink.frm Begin VB.Form Form1 Private Sub blink_Click()
If blink.Caption = "blink on" Then Timer1.Interval = 500 blink.Caption = "blink OFF" Else Timer1.Interval = 0 blink.Caption = "blink on" End If End Sub . . .

20 The File Blink.vbp Type = Exe Form = A:\BLINK.FRM Name="Project1"
RevisionVer = 0 AutoIncrementVer = 0 ServerSupportFiles = 0 VersionCompanyName="UWM EECS Dept." . . .

21 Moving VB Projects VB allows a program file on drive A to use a form file on drive I. Saving (or copying) a project file to another directory or drive will not move its form file If you wish to transport your program on a floppy disk, BE SURE to copy both the .FRM and the .VPB files.

22 The Visual Basic IDE

23 The Workspace & Toolbox

24 Selecting Tools Using the toolbox and the Workspace Window you can build a form that has nearly any desired appearance Double click on an icon in the toolbox to create a new instance of that type of object in your workspace These objects are called controls Using the mouse, a control can be resized or moved

25 The Project Window This window allows you to select and open one or more forms that are used in a given project.

26 The Form Layout Window You may use this window to adjust the position of the form on the CRT screen. Clicking on the “X” will close this window and leave room for other things.

27 The Properties Window This window allows you to examine and modify the various properties of control objects in a program Properties govern the appearance and behavior of a control object They may be modified using the properties window, or by VB code

28 To Learn More More material on the VB window can be found in the textbook Using VB Help you can look under “properties window” or “project window”

29 Click on Contents under Help
Finding Help in VB Click on Contents under Help

30 Finding Visual Basic Help
Clicking on the pull down window marked “Active Subject” or “(entire Collection)” will cause a limit to be placed on the searches Move down to the “Visual Basic Documentation” line

31 Contents Page of Help Screen
When the contents tab is clicked the various “volumes” of help are shown Clicking on the “+” sign opens a volume Clicking on the “-” sign closes it again

32 Click on Index under Help
Indexed Data in VB Help Click on Index under Help

33 Indexed Data

34 Index Items Items shown in gray do not apply to the “Active Subset”
Items shown in black do apply. Often the help is more sophisticated than the question

35 Click on Search under Help
Searching VB Help Click on Search under Help

36 Searching

37 To Learn More An excellent search beginning is to look for a match to “hello visual basic” and just read the hits

Download ppt "Introduction to Programming"

Similar presentations

Ads by Google