1 / 88

Introduction to Computer Programming IT-104 Unit One - An Overview of the Visual Basic IDE and the Visual Basic Form

Lab. MIS. Six Ops. Programs. Languages. Methods. Properties. Events. VB IDE. OOED. Simple Calc. Exit. Introduction to Computer Programming IT-104 Unit One - An Overview of the Visual Basic IDE and the Visual Basic Form. Objectives.

boyd
Download Presentation

Introduction to Computer Programming IT-104 Unit One - An Overview of the Visual Basic IDE and the Visual Basic Form

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab MIS Six Ops Programs Languages Methods Properties Events VB IDE OOED Simple Calc Exit • Introduction to Computer Programming IT-104 Unit One - An Overview of the Visual Basic IDE and the Visual Basic Form Intro to Comp. Programming - IT 104

  2. Objectives • Discuss and understand the rules and procedures that will be used in the computer labs at ITT Tech. • Discuss and understand the course syllabus and objectives. • Discuss and understand the course grading and assignments. Intro to Comp. Programming - IT 104

  3. Objectives • Understand the importance of information systems in organizations. • Discuss the role of computer programs and programming in information systems. • List and discuss the six computer operations. • Describe the difference between modern Windows-based computer languages Intro to Comp. Programming - IT 104

  4. Objectives and older procedural languages. • Discuss the difference between compiled and interpreted languages. • List and discuss the steps in the object-oriented, event-driven programming process. • Discuss the Visual Basic form, how to work with the Visual Basic IDE Intro to Comp. Programming - IT 104

  5. Lab Procedures • The instructor will open the cabinets containing the removable hard drives. • Notice that each one is labeled with a unique tag. • Take the hard drive to the machine with the matching tag. • Use both hands, carry NOTHING ELSE, Intro to Comp. Programming - IT 104

  6. Lab Procedures if you drop the drive, it will be permanently damaged, and you will be responsible for its replacement. • The drive must be inserted into the machine with the label right-side up. • Do not force the drive, it should slide in easily. If not, consult your instructor. Intro to Comp. Programming - IT 104

  7. Lab Procedures • You must now lock the drive in place with one of the drive keys. This prevents the drive from falling out, and also completes the electrical circuit within the computer. • You may now turn on the computer. • If a DOS type text screen appears and asks you to press ‘F1’ (in the lower left hand corner), then do so. Intro to Comp. Programming - IT 104

  8. Lab Procedures • You should now receive a Windows NT boot screen, giving you several choices of operating systems to boot. • Choose Windows NT 4.0 (It should be the default choice) by pressing the ‘Enter’ key. • After Windows NT boots, select ‘Start’ from the taskbar. Intro to Comp. Programming - IT 104

  9. Lab Procedures • Select ‘Programs’, then ‘IT’, then ‘Visual Basic 6.0’. • This will start the Visual Basic IDE (Integrated Development Environment). • At this point, you should be ready to begin working with Visual Basic. Intro to Comp. Programming - IT 104

  10. History of Programming Languages • The first computers (ENIAC was such a machine) were vacuum-tube devices, and they were quite primitive by today’s standards. Programming these machines consisted of technicians climbing about on the machine itself and throwing various switches in the proper sequence, at the proper time. Intro to Comp. Programming - IT 104

  11. History of Programming Languages • As computers evolved into transistor solid state devices, improved methods could be developed to program them, and the notion of the computer program evolved. • A program is nothing more than a logical sequence of instructions to a machine to accomplish a specific task. Intro to Comp. Programming - IT 104

  12. History of Programming Languages • It is generally agreed that the first major language for computers was FORTRAN (an acronym for FORmula TRANslating system), which was developed by the IBM corporation around 1957. • Following FORTRAN’s introduction closely was LISP in 1958, which was developed by John McCarthy of MIT. Intro to Comp. Programming - IT 104

  13. History of Programming Languages • In the late 50’s, as the importance of the computer became increasingly clear, and organizations began to depend upon it, the U.S. government undertook a project to develop a language that was more user-friendly to modeling and processing business systems. The result was COBOL (an acronym for the COmmon Business Intro to Comp. Programming - IT 104

  14. History of Programming Languages Oriented Language). COBOL dominated computing for the next 30 years, but like FORTRAN and its contemporaries, it suffered from a number of deficiencies. The most important of these deficiencies was the inability to write truly portable code, and the difficulty in reusing code modules (or procedures) Intro to Comp. Programming - IT 104

  15. History of Programming Languages • In the early 70’s, Dennis Ritchie, who developed the UNIX operating system along with his colleagues at Bell Labs, created a new programming language to use with the new OS. His language was derived from an existing computer language known simply as B. Ritchie decided jocularly to name his language Intro to Comp. Programming - IT 104

  16. History of Programming Languages C and the name stuck. • C is a function oriented language, that is, great care is given to carefully analyzing the program to be written, and then breaking it down to its simplest component parts. Each of these parts then has a function written for it. Functions may be used and reused within Intro to Comp. Programming - IT 104

  17. History of Programming Languages C program. • C became quite popular, and it is still widely used, but it has difficulty in dealing with Objects and other mathematical abstractions. • To address these shortcomings, Dr. Bjarne Stroustroup took the C language Intro to Comp. Programming - IT 104

  18. History of Programming Languages and added the necessary extensions to implement the Class concept and make C a fully object-oriented language. He called his language C++, and this language is the choice of software developers today world-wide. • Also in the 70’s as Bill Gates rose to prominence in the computing world, Intro to Comp. Programming - IT 104

  19. History of Programming Languages he is generally given credit for developing BASIC(the Beginner’s All-purpose Symbolic Instruction Code). • BASIC was yet another new language, and its simplicity and utility made it a popular choice with neophyte programmers of all ages. Intro to Comp. Programming - IT 104

  20. History of Programming Languages • In the early 80’s, as Graphical User Interfaces (GUIs) began to catch on with computer users, the Microsoft corporation took the BASIC language and ported it to the Windows environment, and VisualBasic was the result. The current version we are using is version 6.0, and a new version Visual Basic.NET has just been Intro to Comp. Programming - IT 104

  21. History of Programming Languages released by microsoft. • There are hundreds of other programming languages; too numerous to list here, each created by someone to serve a specific purpose. The experienced programmer is aware of this and he will choose the appropriate language for the task at hand. Intro to Comp. Programming - IT 104

  22. Information Systems in Business • An information system is the combination of technology (computers) and people that enables an organization to collect data, store them, and transform then into information. • Dataare raw facts that are collected and stored by the information system. Data can be in any form that can be digitized. • Information is created when data are organized into a meaningful form. Intro to Comp. Programming - IT 104

  23. Information Systems in Business • Softwareis composed of one or more lists of instructions called programs, and the process of creating these lists of instructions is called programming. Software is required to convert or process data, and to enable the computer to communicate and coordinate all the various devices required to perform its functions. • The business climate has changed drastically in the past 25 years, so that now virtually any business having more than a couple of employees is dependent on the computer as a tool to store, process, and retrieve business related information. Intro to Comp. Programming - IT 104

  24. The Six Computer Operations • Input data • Store data in internal memory • Perform arithmetic on data • Compare two values and select one of two alternative actions • Repeat a group of actions any number of times • Output the results of processing Intro to Comp. Programming - IT 104

  25. The Six Computer Operations • Input data - Data may be entered from the keyboard, using a mouse, using a scanner, a microphone, or any input device. Traditional mainframe programs use disk drives or magnetic tape drives to input data stored during business operations for later processing during scheduled batch processing or for on-demand processing by users. Intro to Comp. Programming - IT 104

  26. The Six Computer Operations • Store Data in internal memory - Data entered into a program must be stored either completely or partially in the computer’s main memory banks for later use by the various programs used to manipulate the data. Intro to Comp. Programming - IT 104

  27. The Six Computer Operations • Perform arithmetic on data - This is the most common use most people think about when the word computer is mentioned. A computer can perform any mathematical calculation on numerical data that a human can do, and the computer can do it far more quickly, accurately, and consistently than the most conscientious and careful human. Intro to Comp. Programming - IT 104

  28. The Six Computer Operations • Compare two values and select one of two alternative actions - This is a very important concept that is often overlooked in discussing computer operations. A computer can compare two data items, whether or not they are numeric, and take some action based on whether or not the two data items are identical. Intro to Comp. Programming - IT 104

  29. The Six Computer Operations • Repeat a group of actions a number of times - Another often overlooked function of computers is that they can perform tedious, repetitive operations, such as reading in the contents of a multi-million record file, counting very high or very small numbers, using various loop structures, which we will discuss in coming weeks. Intro to Comp. Programming - IT 104

  30. The Six Computer Operations • Output the results of processing - After data has been manipulated or processed, the results can then be displayed on a video display terminal, or sent to a printer, or stored on any number of magnetic or optical storage media, or the output can be directed to any other legitimate output device such as a loud speaker, as in the case of a music editing program. Intro to Comp. Programming - IT 104

  31. Programs and Programming • Logic is a step-by-step process that will solve a problem. A logical process of this type is known as an algorithm. • All programming is simply applied problem solving, utilizing the tools at the disposal of the programmer. • Let’s take a look at a simple algorithm that we all learned in primary school. The multiplication algorithm enables us to multiply numbers having more than one digit per number. Intro to Comp. Programming - IT 104

  32. Programs and Programming A Simple Algorithm (from primary school) 3457 x 117 24199 3457 3457 404469 Intro to Comp. Programming - IT 104

  33. Programming Languages • Low level languages • Machine language - the binary language of the computer (zeros and ones) • Assembly language - one step up, uses simple mnemonics to facilitate usage and understanding • Mid-level languages • C - a function-based language, employs the Intro to Comp. Programming - IT 104

  34. Programming Languages power of pointers • C++ - a superset of C, introduced the concept of objects to programming • High level languages • COBOL- Developed for use by businesses • Fortran - Developed for use by science and engineering • Visual Basic - all are english-like languages, easy to read and comprehend. Intro to Comp. Programming - IT 104

  35. Programming Languages • Machine language program example - will run as you see it. 0001 00101010 11100110 0101 00010010 11110111 0111 10010001 11110110 0010 01100101 01011011 1010 11011011 01011010 0101 10000001 01001100 The spaces and lines have been added here for ease of reading only. They wouldn’t exist in a real file. Intro to Comp. Programming - IT 104

  36. Programming Languages • Assembly language example - must be compiled first. Include windows.inc .model tiny load reg1, 01011011 ;; 91 into arithmetic register one load reg2, 00001010 ;; 10 into arithmetic register two add reg1,reg2 ;; add register one to register two movr reg2,reg3 ;; move register two to three snd addr, 0100010101 ;; send results to output window Intro to Comp. Programming - IT 104

  37. Programming Languages • C ++ language example - must be compiled first. // Add.cpp - Program to add two numbers together #include <iostream.h> int main() { int num_one(74), num_two(28); cout << “The sum of the two numbers is : “ << num_one + num_two << endl; return 0; } Intro to Comp. Programming - IT 104

  38. Programming Languages • Visual Basic language example - must be compiled or interpreted Public Sub cmdAdd_click() dim FirstNumber as integer, SecondNumber as integer dim Result as integer FirstNumber = txtFirstNumber SecondNumber = txtSecondNumber Result = FirstNumber + SecondNumber txtResult = Result End Sub Intro to Comp. Programming - IT 104

  39. Programming Languages • A computer program must either be compiled or interpreted. • An interpreter converts the high level language statements into machine code, one at a time, as the program is executed. • A compilerconverts the entire program into machine code, and then links it with various other necessary files to produce an executable file or program. This finished program can be Intro to Comp. Programming - IT 104

  40. Programming Languages runor executed by simply typing its name at a command line, or by selecting its icon in a windows environment. • The original program file or source code, is no longer recognizable when the executable program is opened using any text editor as you can see in the next slide. Intro to Comp. Programming - IT 104

  41. A Sample Executable Program This is the language the computer understands. The file contains mostly non-display characters that give unusual characters you see here whenever you try to display them with a text editor. Intro to Comp. Programming - IT 104

  42. A Typical Compiler Implementation Translates our English-like commands and statements into machine language, which is the only language that the computer can understand. Intro to Comp. Programming - IT 104

  43. Programming Methods • There are essentially two different methods of programming. • Procedural programming - was and still is used on mainframe computers, as well as on most command line based operating systems. These programs run from start to finish with no intervention from the user other than input. Typically submitted by typing a command at a command line, or by clicking an icon if the program operates within a Graphical User Interface. Intro to Comp. Programming - IT 104

  44. Programming Methods • Event-driven programming(OOED) - adopted for the windows and windows-style operating systems. • An event is something that the operating system is aware of, and it can react to the event. A mouse click, or pressing a key on the keyboard are examples of events. • Object-Oriented Event-Driven programming uses objects, or self-contained modules that combine data and program code which pass strictly defined messages to one another. • OOED is easier to work with, because it is more intuitive than traditional programming methods. • Visual Basic is an OOED language. Intro to Comp. Programming - IT 104

  45. Programming Methods • Visual Basic comes with several hundred controls provided by Microsoft, and each of these controls has some number of defined events (by Microsoft) and experienced programmers can create and code their own events, if needed. • Object-oriented languages use identifiable shapes or structures. • Each object has a set of propertiesassociated it. Programmers must learn to use these properties to properly manipulate and use the object itself. Intro to Comp. Programming - IT 104

  46. Programming Methods • Each object has a set of methods associated with it that the object can carry out. Methods are simply executable code that is written for and stored with the object. • Each object can respond to specific set of events. • The events that an object can respond to will vary with what the object was designed by the programmer to do. Intro to Comp. Programming - IT 104

  47. Programming Basics • The Basic foundation within Visual Basic is the Form. When you start Visual Basic, you will usually have a default form (form1), and a default project (project1). • The Form is our first example of an object. • Let us examine the form and discuss the properties associated with the Form. • The Form in Visual Basic has a set of 51 properties associated with it. Intro to Comp. Programming - IT 104

  48. Properties and Objects • By changing the settings of these properties, we can change the behavior of the form. • Some of the properties are simple switches, that is they are either true or false, off or on. The Visibleproperty is an example of such a property. • Other properties have integer values associated with them. For example, the BorderStyleproperty has six integer values (0 to 5) that can Intro to Comp. Programming - IT 104

  49. Properties and Objects be chosen when the form is created. • Still other properties may have numbers associated with them, such as the Height and Width properties of the form. • Finally, some properties have string values associated with them. The Name property is typically a string value. • The settings of properties help to determine Intro to Comp. Programming - IT 104

  50. Properties and Objects how an object will respond to various events within the operating system and program. Intro to Comp. Programming - IT 104

More Related