Presentation on theme: "Introduction to Programming. Software Development Life Cycle Gather Requirements Design Program Code & Test Program Implement u Software Development has."— Presentation transcript:
Introduction to Programming
Software Development Life Cycle Gather Requirements Design Program Code & Test Program Implement u Software Development has four main phases Gathering Requirements Program Design Coding & Testing the Program Implementing the Program
CS132 Development Life Cycle Gather Requirements Design Program Code & Test Program Implement u Get requirements document from D2L Make sure you understand the requirements u Design the form layout u Add code to the program to meet the requirements u Test the program under several possible scenarios u Submit program for grading in the D2L dropbox
Program Design Basics u 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
Design Tools u 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 u Flowchart - a graphical language used to communicate the logic of a program
Describing an Algorithm with Pseudocode u 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 u What is left out?
Flowcharts u An alternative, graphical way to describe a program’s design System Flowchart Program Flowchart
Implementing design u 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
The Windows File System u Double clicking on the “My Computer” icon will invoke the process shown. u There are four views of the data, two are shown. u Normally, only one view of the window will appear until you open sub-menus.
Copying Files u Open two “My Computer” windows, one for the area with files in it and one for the destination area u Mark file(s) in first window to be copied u Click on Edit-Copy u Move to other window u Click on Edit-Paste
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.
(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.
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.
Engineering Lab Drives
I & M T Lab Drives Drive P on this system is not the same space as Drive I in the Engineering lab system.
Visual Basic (VB) u We will be using the Engineering Laboratory to study programming in the Visual Basic Language. u In the pictures that follow we will examine how that tool is installed in the Engineering Laboratory, other machines will most certainly differ.
Accessing Visual Basic (VB)
Visual Basic Files u 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. u Both of them are text files.
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...
The File Blink.vbp Type = Exe Form = A:\BLINK.FRM Name="Project1" RevisionVer = 0 AutoIncrementVer = 0 ServerSupportFiles = 0 VersionCompanyName="UWM EECS Dept."...
Moving VB Projects u 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.
The Visual Basic IDE
The Workspace & Toolbox
Selecting Tools u 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
The Project Window u This window allows you to select and open one or more forms that are used in a given project.
u You may use this window to adjust the position of the form on the CRT screen. u Clicking on the “X” will close this window and leave room for other things. The Form Layout Window
u 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 The Properties Window
To Learn More u More material on the VB window can be found in the textbook u Using VB Help you can look under “properties window” or “project window”
Finding Help in VB Click on Contents under Help
Finding Visual Basic Help u Clicking on the pull down window marked “Active Subject” or “(entire Collection)” will cause a limit to be placed on the searches u Move down to the “Visual Basic Documentation” line
Contents Page of Help Screen u When the contents tab is clicked the various “volumes” of help are shown u Clicking on the “+” sign opens a volume u Clicking on the “-” sign closes it again
Indexed Data in VB Help Click on Index under Help
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
Searching VB Help Click on Search under Help
To Learn More u An excellent search beginning is to look for a match to “hello visual basic” and just read the hits