Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 1 Getting Started with Programming using Visual Studio.

Similar presentations


Presentation on theme: "Lecture 1 Getting Started with Programming using Visual Studio."— Presentation transcript:

1 Lecture 1 Getting Started with Programming using Visual Studio

2 What is Software?

3 An aging maintenance man at an engineering plant was forced into retirement as a money-saving measure following extensive modernization of the plant. Soon after leaving, he was called back to help fix some of the equipment that had broken down and was not responding to the trouble-shooting methods being recommended by the newly installed automated control system. The elderly maintenance man walked into a maze of pipes, took out a hammer and gave one of the pipes a sturdy whack. The machinery immediately starting running. The maintenance man sent the plant manager the following invoice: Fee for service................................................. $1,000.00 Hitting pipe with hammer.................................. $ 1.00 Knowing which pipe to hit................................. $ 999.00 Implementing a Program is NOT the Hard Part

4 Calculate your car’s gas mileage. We need two odometer readings, and the number of gallons of gas used between them. 1.Fill tank 2.Record first odometer reading 3.Drive a while 4.Fill tank and note number of gallons required. 5.Record second odometer reading 6.Divide difference in odometer readings by the number of gallons used. Live demo in Class What types of things should we test? Software Development Process

5 Structured Procedural Programming In a structured program, the computer controls the sequence of operations. When the program needs input from the user, a message is displayed and the program will wait for the user to respond. Otherwise the program moves through the program step-by-step until the intended results are ready to be displayed to the user or stored for later use. Structured procedural programs can be implemented as console applications.

6 Object-Oriented Programming In this course we are going to side-step a lot of the “hoopla” associated with object-oriented programming. As stated in the (Doyle) textbook, The concept behind object-oriented programming (OOP) is the applications can be organized around objects rather than processes. While there is a lot of other aspects of OOP, they are more about the theory than the practice of writing programs. For our purposes we note that the graphical elements in a graphical user interface (GUI) program such as buttons, textboxes, counters, sliders, menus, etc...are objects. We will write software that performs specific functions whenever the user interacts with these objects. These functions and methods are known as event-handlers. The sequence of operations in a GUI application are controlled by the user rather than the computer.

7 We want (need) to see the File Extensions

8 Building a Console Application

9

10

11 Building a Windows Forms Application For the class desktop computers we will need to change the working directory... Using the Desktop will make it easier for us to find the project.

12 Dragging and Dropping Controls onto a Form

13 Changing the Properties of a Control

14 Adding an Even-Handler to a Control Double-clicking the “Click Me” button creates code for a click event handler. We add the MessagBox.Show line to the body of this method. Now we are ready to run this program. Click on the green triangle under the Debug menu.

15


Download ppt "Lecture 1 Getting Started with Programming using Visual Studio."

Similar presentations


Ads by Google