Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects

Size: px
Start display at page:

Download "Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects"

Transcription

1 1 Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects Outline 19.1 Test-Driving the Microwave Oven Application 19.2 Designing the Microwave Oven Application 19.3 Adding a New Class to the Project 19.4 Initializing Class Objects: Constructors 19.5 Properties 19.6 Completing the Microwave Oven Application 19.7 Controlling Access to Members 19.8 Using the Debugger: The Autos and Locals Windows 19.9 Wrap-Up

2 2 Objectives In this tutorial, you will learn to: Create your own classes. Create and use objects of your own classes. Control access to object instance variables. Use keyword private. Create your own properties. Use the Panel control. Use String methods PadLeft and Substring.

3 19.1 Test-Driving the Microwave Oven Application 3 Application Requirements An electronics company is considering building microwave ovens. The company has asked you to develop an application that simulates a microwave oven. The oven will contain a keypad that allows the user to specify the microwave cook time, which is displayed for the user. Once a time is entered, the user clicks the Start Button to begin the cooking process. The microwave s glass window changes color (from gray to yellow) to simulate the oven s light that remains on while the food cooks, and a timer counts down one second at a time. Once the time expires, the color of the microwave s glass window returns to gray (indicating that the microwave s light is now off) and the microwave displays the text Done!. The user can click the Clear Button at any time to stop the microwave and enter a new time. The user should be able to enter a number of minutes no larger than 59 and a number of seconds no larger than 59; otherwise, the invalid cook time will be set to zero. A beep will be sounded whenever a numeric Button is clicked, and when the microwave oven has finished a countdown.

4 19.1 Test-Driving the Microwave Oven Application 4 Figure 19.1 Microwave Oven application s Form. Microwave s glass window Numeric keypad (Buttons appear flat)

5 19.1 Test-Driving the Microwave Oven Application 5 Figure 19.2 Microwave Oven application accepts only four digits.

6 19.1 Test-Driving the Microwave Oven Application 6 Figure 19.3 Microwave Oven application with invalid input.

7 19.1 Test-Driving the Microwave Oven Application 7 Figure 19.4 Microwave Oven application after invalid input has been entered and the Start Button clicked.

8 19.1 Test-Driving the Microwave Oven Application 8 Figure 19.5 Microwave Oven application with valid time entered and inside light turned on (it s now cooking). Color yellow simulates the microwave light

9 19.1 Test-Driving the Microwave Oven Application 9 Figure 19.6 Microwave Oven application after the cooking time has elapsed. Label displays Done! when cooking is finished Color returns to default color to simulate that cooking has finished

10 19.2 Designing the Microwave Oven Application 10 Panel control Can group controls as do GroupBoxes Cannot display a caption

11 19.2 Designing the Microwave Oven Application 11 Action Control/Object Event bntone, btntwo, btnthree, btnfour, btnfive, btnsix, btnseven, btneight, btnnine, btnzero Click Display the formatted time Store the minutes and seconds Display the formatted time Begin countdown Start timer Turn microwave light on Decrease time by one second If new time is zero Stop the countdown Display text Done! Turn microwave light off else Display new time Display Text Microwave Oven Clear input Stop the countdown Turn microwave light off lbldisplay btnstart m_objtime lbldisplay tmrclock pnlwindow tmrclock m_objtime m_objtime tmrclock lbldisplay pnlwindow lbldisplay btnclear lbldisplay m_strtime tmrclock pnlwindow Click Tick Click Figure 19.7 ACE table for the Microwave Oven application.

12 19.2 Designing the Microwave Oven Application 12 Figure 19.8 Rearranging and commenting the new control declaration.

13 19.2 Designing the Microwave Oven Application 13 Figure 19.9 Variable m_strtime contains the user s input.

14 19.2 Designing the Microwave Oven Application 14 Figure Typical numeric event handler. When a number is entered, add the number to the input and display the new time

15 19.2 Designing the Microwave Oven Application 15 Figure btnstart_click creates an object to store time and begin cooking Microwave Oven application s remaining event handlers. btnclear_click resets variables and Label DisplayTime formats time information for display tmrclock_click performs countdown and updates display

16 Adding a New Class to the Project Adding a class file to your project Select Project > Add Class In the Add New Item dialog, select Class, and enter a name for the class

17 19.3 Adding a New Class to the Project 17 Figure Add New Item dialog allows you to create a new class. Select Class as new item Name of new class

18 19.3 Adding a New Class to the Project 18 Figure Solution Explorer displaying new class file. New file displayed in Solution Explorer

19 19.3 Adding a New Class to the Project 19 Figure Default class declaration. Empty class definition added by Visual Studio.NET

20 19.3 Adding a New Class to the Project 20 Figure Time s instance variables. Instance variables store minute and second information Instance variables of a class are defined within its class definition

21 Initializing Class Objects: Constructors Constructor Special method within a class definition that is used to initialize a class s instance variables. Can take arguments but cannot return values Has same name as class containing it Initializing variables in a constructor Time m_objtimeobject = new Time( 5, 3 ); Notice the new keyword Extensible languages Languages that can be extended with new data types C# is an extensible language

22 19.4 Initializing Class Objects: Constructors 22 Figure Empty constructor. Time is the constructor method

23 19.4 Initializing Class Objects: Constructors 23 Figure Constructor initializing instance variables. Initialize instance variables

24 19.4 Initializing Class Objects: Constructors 24 Figure Declaring an object of type Time. Declare m_objtime of programmerdefined type Time Instantiate (create) an object of type Time

25 25 Properties 19.5 Properties Provided to allow clients to access and modify instance variables safely Contain accessors Property definition Consists of two accessors set accessor allows clients to set properties get accessor allows clients to get properties

26 19.5 Properties 26 Figure Empty Minute property. get accessor retrieves data set accessor stores data The accessor methods are meant to keep the property in a consistent state (that is, valid)

27 19.5 Properties 27 Figure get accessor definition. Returning data from a property

28 19.5 Properties 28 Figure set accessor definition. Properties used to validate data

29 19.5 Properties 29 Figure Second property. Property Second

30 19.5 Properties 30 Figure Second property definition. Second property performs similar data manipulations

31 19.5 Properties 31 Figure Constructor using properties to initialize variables. Safer to assign data to properties rather than instance variables, because set accessors perform validity checking

32 19.6 Completing the Microwave Oven Application 32 String methods Length property returns the number of characters in a string Padleft Adds characters to the beginning of the string until the length of the string equals the specified length Substring returns specified characters from a string

33 19.6 Completing the Microwave Oven Application 33 Figure Declaring variables for second and minute values. Ensure m_strtime has four characters for conversion purposes

34 19.6 Completing the Microwave Oven Application 34 Figure Forming minute and second values from input. Extracting seconds and minutes

35 19.6 Completing the Microwave Oven Application 35 Figure Creating a Time object. Use keyword new to create a new object

36 19.6 Completing the Microwave Oven Application 36 Figure Time appearing as a type in an Intellisense window. Time appears as a type in the Intellisense window

37 19.6 Completing the Microwave Oven Application 37 Figure Displaying time information with separating colon. Display time information

38 19.6 Completing the Microwave Oven Application 38 Figure Properties of a programmer-defined type also appear in Intellisense. Time s properties appear in Intellisense

39 19.6 Completing the Microwave Oven Application 39 Figure Starting the microwave oven countdown. Start timer and turn light on to indicate microwave oven is cooking

40 19.6 Completing the Microwave Oven Application 40 Clearing the cook time Set application s Label to Microwave Oven Clear m_strtime Reset Time object to zero minutes and zero seconds Stop the countdown by disabling Timer Set Panel s background to the Panel s original color Simulates turning off light

41 19.6 Completing the Microwave Oven Application 41 Figure Clearing the Microwave Oven input. Clearing the input

42 19.6 Completing the Microwave Oven Application 42 Displaying data as it is being input Declare int variables for storing minute and second Declare string variable Displays current input in proper format Remove extra digits entered by user

43 19.6 Completing the Microwave Oven Application 43 Figure Modifying invalid user input.

44 19.6 Completing the Microwave Oven Application 44 Figure Display current input.

45 19.6 Completing the Microwave Oven Application 45 Figure Modifying the display during countdown. Modify Time appropriately during countdown

46 Controlling Access to Members Member-access modifiers public Specifies that instance variables and methods are accessible wherever the application has a reference to that object private Specifies that instance variables or methods are accessible only to methods, properties and events of that class

47 19.7 Controlling Access to Members 47 Figure Time s instance variables are private.

48 19.7 Controlling Access to Members 48 Figure FrmMicrowaveOven s instance variables are private.

49 19.7 Controlling Access to Members 49 Figure FrmMicrowaveOven s methods are private.

50 1 using System; 2 using System.Drawing; 3 using System.Collections; 4 using System.ComponentModel; 5 using System.Windows.Forms; 6 using System.Data; 7 8 namespace MicrowaveOven 9 { 10 /// <summary> 11 /// Summary description for FrmMicrowaveOven. 12 /// </summary> 13 public class FrmMicrowaveOven : System.Windows.Forms.Form 14 { 15 // Panel for the microwave's window 16 private System.Windows.Forms.Panel pnlwindow; // Panel for the microwave's buttons 19 private System.Windows.Forms.Panel pnlcontrol; // Label and Timer for the microwave's timer display 22 private System.Windows.Forms.Label lbldisplay; 23 private System.Windows.Forms.Timer tmrclock; 24 Outline MicrowaveOven.cs (1 of 11) 50

51 25 // Buttons of the microwave 26 private System.Windows.Forms.Button btnone; 27 private System.Windows.Forms.Button btntwo; 28 private System.Windows.Forms.Button btnthree; 29 private System.Windows.Forms.Button btnfour; 30 private System.Windows.Forms.Button btnfive; 31 private System.Windows.Forms.Button btnsix; 32 private System.Windows.Forms.Button btnseven; 33 private System.Windows.Forms.Button btneight; 34 private System.Windows.Forms.Button btnnine; 35 private System.Windows.Forms.Button btnzero; 36 private System.Windows.Forms.Button btnstart; 37 private System.Windows.Forms.Button btnclear; /// <summary> 40 /// Required designer variable. 41 /// </summary> 42 private System.ComponentModel.IContainer components; // contains time entered as a string 45 private string m_strtime = ""; // contains time entered 48 private Time m_objtime; 49 Declaring instance variable as private Creating an object of a programmerdefined type Outline MicrowaveOven.cs (2 of 11) 51

52 50 public FrmMicrowaveOven() 51 { 52 // 53 // Required for Windows Form Designer support 54 // 55 InitializeComponent(); // 58 // TODO: Add any constructor code after InitializeComponent 59 // call 60 // 61 } /// <summary> 64 /// Clean up any resources being used. 65 /// </summary> 66 protected override void Dispose( bool disposing ) 67 { 68 if( disposing ) 69 { 70 if (components!= null) 71 { 72 components.dispose(); 73 } 74 } 75 base.dispose( disposing ); Outline MicrowaveOven.cs (3 of 11) 52

53 76 } // Windows Form Designer generated code /// <summary> 81 /// The main entry point for the application. 82 /// </summary> 83 [STAThread] 84 static void Main() 85 { 86 Application.Run( new FrmMicrowaveOven() ); 87 } // event handler appends 1 to time string 90 private void btnone_click( 91 object sender, System.EventArgs e ) 92 { 93 m_strtime += "1"; // append digit to time input 94 DisplayTime(); // display time input properly } // end method btnone_click 97 Outline MicrowaveOven.cs (4 of 11) 53

54 98 // event handler appends 2 to time string 99 private void btntwo_click( 100 object sender, System.EventArgs e ) 101 { 102 m_strtime += "2"; // append digit to time input 103 DisplayTime(); // display time input properly } // end method btntwo_click // event handler appends 3 to time string 108 private void btnthree_click( 109 object sender, System.EventArgs e ) 110 { 111 m_strtime += "3"; // append digit to time input 112 DisplayTime(); // display time input properly } // end method btnthree_click // event handler appends 4 to time string 117 private void btnfour_click( 118 object sender, System.EventArgs e ) 119 { 120 m_strtime += "4"; // append digit to time input 121 DisplayTime(); // display time input properly } // end method btnfour_click Outline MicrowaveOven.cs (5 of 11) 54

55 // event handler appends 5 to time string 126 private void btnfive_click( 127 object sender, System.EventArgs e ) 128 { 129 m_strtime += "5"; // append digit to time input 130 DisplayTime(); // display time input properly } // end method btnfive_click // event handler appends 6 to time string 135 private void btnsix_click( 136 object sender, System.EventArgs e ) 137 { 138 m_strtime += "6"; // append digit to time input 139 DisplayTime(); // display time input properly } // end method btnsix_click // event handler appends 7 to time string 144 private void btnseven_click( 145 object sender, System.EventArgs e ) 146 { 147 m_strtime += "7"; // append digit to time input 148 DisplayTime(); // display time input properly } // end method btnseven_click Outline MicrowaveOven.cs (6 of 11) 55

56 // event handler appends 8 to time string 153 private void btneight_click( 154 object sender, System.EventArgs e ) 155 { 156 m_strtime += "8"; // append digit to time input 157 DisplayTime(); // display time input properly } // end method btneight_click // event handler appends 9 to time string 162 private void btnnine_click( 163 object sender, System.EventArgs e ) 164 { 165 m_strtime += "9"; // append digit to time input 166 DisplayTime(); // display time input properly } // end method btnnine_click // event handler appends 0 to time string 171 private void btnzero_click( 172 object sender, System.EventArgs e ) 173 { 174 m_strtime += "0"; // append digit to time input 175 DisplayTime(); // display time input properly Outline MicrowaveOven.cs (7 of 11) 56

57 } // end method btnzero_click // event handler starts the microwave oven's cooking process 180 private void btnstart_click( 181 object sender, System.EventArgs e ) 182 { 183 int intsecond; 184 int intminute; // ensure that m_strtime has 4 characters 187 m_strtime = m_strtime.padleft( 4, Convert.ToChar( "0" ) ); // extract seconds and minutes 190 intsecond = Int32.Parse( m_strtime.substring( 2 ) ); 191 intminute = Int32.Parse( m_strtime.substring( 0, 2 ) ); // create Time object to contain time entered by user 194 m_objtime = new Time( intminute, intsecond ); lbldisplay.text = String.Format( "{0:D2}:{1:D2}", 197 m_objtime.minute, m_objtime.second ); m_strtime = ""; // clear m_strtime for future input 200 Creating a new object of a programmerdefined type Accessing properties of a programmerdefined type Outline MicrowaveOven.cs (8 of 11) 57

58 201 tmrclock.enabled = true; // start timer pnlwindow.backcolor = Color.Yellow; // turn "light" on } // end method btnstart_click // event handler to clear input 208 private void btnclear_click( 209 object sender, System.EventArgs e ) 210 { 211 // reset each property or variable to its initial setting 212 lbldisplay.text = "Microwave Oven"; 213 m_strtime = ""; 214 m_objtime = new Time( 0, 0 ); 215 tmrclock.enabled = false; 216 pnlwindow.backcolor = SystemColors.Control; } // end method btnclear_click // method to display formatted time in timer window 221 private void DisplayTime() 222 { 223 int intsecond; 224 int intminute; 225 Outline MicrowaveOven.cs (9 of 11) Use the BackColor property to change the Panel s color Use the SystemColors.Control property to restore the default background color to the Panel Declaring a method as private 58

59 226 string strdisplay; // string displays current input // if too much input entered 229 if ( m_strtime.length > 4 ) 230 { 231 m_strtime = m_strtime.substring( 0, 4 ); 232 } strdisplay = m_strtime.padleft( 4, Convert.ToChar( "0" ) ); // extract seconds and minutes 237 intsecond = Int32.Parse( strdisplay.substring( 2 ) ); 238 intminute = Int32.Parse( strdisplay.substring( 0, 2 ) ); // display number of minutes, ":" and number of seconds 241 lbldisplay.text = String.Format( "{0:D2}:{1:D2}", 242 intminute, intsecond ); } // end method DisplayTime // event handler displays new time each second 247 private void tmrclock_tick( 248 object sender, System.EventArgs e ) 249 { 250 // perform countdown, subtract one second The Length property returns number of characters in a string The Substring method returns a subset of characters in a string The PadLeft method appends characters to the beginning of a string Outline MicrowaveOven.cs (10 of 11) 59

60 251 if ( m_objtime.second > 0 ) 252 { 253 m_objtime.second--; 254 } 255 else if ( m_objtime.minute > 0 ) 256 { 257 m_objtime.minute--; // subtract one minute 258 m_objtime.second = 59; // reset seconds for new minute 259 } 260 else // no more seconds 261 { 262 tmrclock.enabled = false; // stop timer 263 lbldisplay.text = "Done!"; // tell user time is finished 264 pnlwindow.backcolor = SystemColors.Control; 265 return; 266 } lbldisplay.text = String.Format( "{0:D2}:{1:D2}", 269 m_objtime.minute, m_objtime.second ); } // end method tmrclock_tick } // end class FrmMicrowaveOven 274 } Outline MicrowaveOven.cs (11 of 11) 60

61 1 // Time.cs 2 // Represents time data and contains properties. 3 4 using System; 5 6 namespace MicrowaveOven 7 { 8 /// <summary> 9 /// Summary description for Time. 10 /// </summary> 11 public class Time 12 { 13 // declare ints for minute and second 14 private int m_intminute; 15 private int m_intsecond; // Time constructor, minute and second supplied 18 public Time( int minutevalue, int secondvalue ) 19 { 20 Minute = minutevalue; // invokes Minute set accessor 21 Second = secondvalue; // invokes Second set accessor } // end constructor Time 24 Keyword class used to define a class Right brace ends constructor definition Constructor name must be the class name Time.cs (1 of 4) Assign data to properties rather than to instance variables directly Outline 61

62 25 // property Minute 26 public int Minute 27 { 28 // return m_intminute value 29 get 30 { 31 return m_intminute; } // end of get accessor // set m_intminute value 36 set 37 { 38 // if minute value entered is valid 39 if ( value < 60 ) 40 { 41 m_intminute = value; 42 } 43 else 44 { 45 m_intminute = 0; // set invalid input to 0 46 } } // end of set accessor } // end property Minute Time.cs (2 of 4) Outline 62

63 51 52 // property Second 53 public int Second 54 { 55 // return m_intsecond value 56 get 57 { 58 return m_intsecond; } // end of get accessor // set m_intsecond value 63 set 64 { 65 // if minute value entered is valid 66 if ( value < 60 ) 67 { 68 m_intsecond = value; 69 } 70 else 71 { 72 m_intsecond = 0; // set invalid input to 0 73 } } // end of set accessor get accessor returns data set accessor modifies data Time.cs (3 of 4) Outline 63

64 76 77 } // end property Second } // end class Time Right brace ends property 80 } definition Time.cs Right brace ends class (4 of 4) declaration Outline 64

65 19.8 Using the Debugger: The Autos and Locals Windows 65 Autos and Locals windows Allow the client to view the values stored in an object s instance variables Autos window Displays the contents of the properties used in the next and last statement to be executed Locals window Displays the state of the variables in the current scope

66 19.8 Using the Debugger: The Autos and Locals Windows 66 Figure Microwave Oven application with breakpoints added.

67 19.8 Using the Debugger: The Autos and Locals Windows 67 Figure Empty Autos window. Figure Empty Locals window.

68 19.8 Using the Debugger: The Autos and Locals Windows 68 Figure Autos window displaying the state of m_objtime. Properties of m_objtime Property values Property types

69 19.8 Using the Debugger: The Autos and Locals Windows 69 Figure Locals window displaying the state of m_objtime. Instance variables of m_objtime

70 19.8 Using the Debugger: The Autos and Locals Windows 70 Figure Autos window displaying changed variables in red. Changed values shown in red Figure Locals window displaying changed variables in red.

71 19.8 Using the Debugger: The Autos and Locals Windows 71 Figure Changing the value of a variable in the Autos window. Value changed by user Double clicking a value allows the client to change the value while application is running

72 19.8 Using the Debugger: The Autos and Locals Windows 72 Figure New variables listed in the Autos window. New variables shown in Autos window There are new variables in the Autos window because execution has reached a statement that uses different variables

Tutorial 5 Completing the Inventory Application Introducing Programming

Tutorial 5 Completing the Inventory Application Introducing Programming 1 Tutorial 5 Completing the Inventory Application Introducing Programming Outline 5.1 Test-Driving the Inventory Application 5.2 Introduction to C# Code 5.3 Inserting an Event Handler 5.4 Performing a

More information

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic Outline 6.1 Test-Driving the Enhanced Inventory Application 6.2 Variables 6.3 Handling the TextChanged

More information

Classes in C# namespace classtest { public class myclass { public myclass() { } } }

Classes in C# namespace classtest { public class myclass { public myclass() { } } } Classes in C# A class is of similar function to our previously used Active X components. The difference between the two is the components are registered with windows and can be shared by different applications,

More information

CSC 330 Object-Oriented Programming. Encapsulation

CSC 330 Object-Oriented Programming. Encapsulation CSC 330 Object-Oriented Programming Encapsulation Implementing Data Encapsulation using Properties Use C# properties to provide access to data safely data members should be declared private, with public

More information

Inheriting Windows Forms with Visual C#.NET

Inheriting Windows Forms with Visual C#.NET Inheriting Windows Forms with Visual C#.NET Overview In order to understand the power of OOP, consider, for example, form inheritance, a new feature of.net that lets you create a base form that becomes

More information

User-Defined Controls

User-Defined Controls C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

Flag Quiz Application

Flag Quiz Application T U T O R I A L 17 Objectives In this tutorial, you will learn to: Create and initialize arrays. Store information in an array. Refer to individual elements of an array. Sort arrays. Use ComboBoxes to

More information

1. Windows Forms 2. Event-Handling Model 3. Basic Event Handling 4. Control Properties and Layout 5. Labels, TextBoxes and Buttons 6.

1. Windows Forms 2. Event-Handling Model 3. Basic Event Handling 4. Control Properties and Layout 5. Labels, TextBoxes and Buttons 6. C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

Polymorphism. Polymorphism. CSC 330 Object Oriented Programming. What is Polymorphism? Why polymorphism? Class-Object to Base-Class.

Polymorphism. Polymorphism. CSC 330 Object Oriented Programming. What is Polymorphism? Why polymorphism? Class-Object to Base-Class. Polymorphism CSC 0 Object Oriented Programming Polymorphism is considered to be a requirement of any true -oriented programming language (OOPL). Reminder: What are the other two essential elements in OOPL?

More information

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; Exercise 9.3 In Form1.h #pragma once #include "Form2.h" Add to the beginning of Form1.h #include #include For srand() s input parameter namespace Tst_Form using namespace System; using

More information

This is the start of the server code

This is the start of the server code This is the start of the server code using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Net; using System.Net.Sockets;

More information

Web Services in.net (2)

Web Services in.net (2) Web Services in.net (2) These slides are meant to be for teaching purposes only and only for the students that are registered in CSE4413 and should not be published as a book or in any form of commercial

More information

CALCULATOR APPLICATION

CALCULATOR APPLICATION CALCULATOR APPLICATION Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

You can call the project anything you like I will be calling this one project slide show.

You can call the project anything you like I will be calling this one project slide show. C# Tutorial Load all images from a folder Slide Show In this tutorial we will see how to create a C# slide show where you load everything from a single folder and view them through a timer. This exercise

More information

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

Lampiran B. Program pengendali

Lampiran B. Program pengendali Lampiran B Program pengendali #pragma once namespace serial using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms;

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Professional ASP.NET Web Services : Asynchronous Programming

Professional ASP.NET Web Services : Asynchronous Programming Professional ASP.NET Web Services : Asynchronous Programming To wait or not to wait; that is the question! Whether or not to implement asynchronous processing is one of the fundamental issues that a developer

More information

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL:

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL: Send SMS via SOAP API Introduction You can seamlessly integrate your applications with aql's outbound SMS messaging service via SOAP using our SOAP API. Sending messages via the SOAP gateway WSDL file

More information

Arrays. Arrays: Declaration and Instantiation. Array: An Array of Simple Values

Arrays. Arrays: Declaration and Instantiation. Array: An Array of Simple Values What Are Arrays? CSC 0 Object Oriented Programming Arrays An array is a collection variable Holds multiple values instead of a single value An array can hold values of any type Both objects (reference)

More information

Web Services in.net (7)

Web Services in.net (7) Web Services in.net (7) These slides are meant to be for teaching purposes only and only for the students that are registered in CSE4413 and should not be published as a book or in any form of commercial

More information

#pragma comment(lib, "irrklang.lib") #include <windows.h> namespace SuperMetroidCraft {

#pragma comment(lib, irrklang.lib) #include <windows.h> namespace SuperMetroidCraft { Downloaded from: justpaste.it/llnu #pragma comment(lib, "irrklang.lib") #include namespace SuperMetroidCraft using namespace System; using namespace System::ComponentModel; using namespace

More information

An array can hold values of any type. The entire collection shares a single name

An array can hold values of any type. The entire collection shares a single name CSC 330 Object Oriented Programming Arrays What Are Arrays? An array is a collection variable Holds multiple values instead of a single value An array can hold values of any type Both objects (reference)

More information

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them.

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them. We are working on Visual Studio 2010 but this project can be remade in any other version of visual studio. Start a new project in Visual Studio, make this a C# Windows Form Application and name it zombieshooter.

More information

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0.

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0. Sub To Srt Converter This is the source code of this program. It is made in C# with.net 2.0. form1.css /* * Name: Sub to srt converter * Programmer: Paunoiu Alexandru Dumitru * Date: 5.11.2007 * Description:

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1

and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1 Chapter 6 How to code methods and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1 Objectives Applied 1. Given the specifications for a method, write the method. 2. Give

More information

CSIS 1624 CLASS TEST 6

CSIS 1624 CLASS TEST 6 CSIS 1624 CLASS TEST 6 Instructions: Use visual studio 2012/2013 Make sure your work is saved correctly Submit your work as instructed by the demmies. This is an open-book test. You may consult the printed

More information

Start Visual Studio, create a new project called Helicopter Game and press OK

Start Visual Studio, create a new project called Helicopter Game and press OK C# Tutorial Create a helicopter flying and shooting game in visual studio In this tutorial we will create a fun little helicopter game in visual studio. You will be flying the helicopter which can shoot

More information

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK.

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Before you start - download the game assets from above or on MOOICT.COM to

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Using the Xcode Debugger

Using the Xcode Debugger g Using the Xcode Debugger J Objectives In this appendix you ll: Set breakpoints and run a program in the debugger. Use the Continue program execution command to continue execution. Use the Auto window

More information

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un numar binar, in numar zecimal. Acest program are 4 numericupdown-uri

More information

Web Services in.net (6) cont d

Web Services in.net (6) cont d Web Services in.net (6) cont d These slides are meant to be for teaching purposes only and only for the students that are registered in CSE3403 and should not be published as a book or in any form of commercial

More information

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer..

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer.. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

Hands-On Lab (MBL04) Lab Manual Incorporating COM Objects into Your.NET Compact Framework 2.0 Application

Hands-On Lab (MBL04) Lab Manual Incorporating COM Objects into Your.NET Compact Framework 2.0 Application Hands-On Lab (MBL04) Lab Manual Incorporating COM Objects into Your.NET Compact Framework 2.0 Application Please do not remove this manual from the lab Information in this document is subject to change

More information

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project.

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project. C# Tutorial - Create a Batman Gravity Run Game Start a new project in visual studio and call it gravityrun It should be a windows form application with C# Click OK Change the size of the to 800,300 and

More information

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox] C# Tutorial - Create a Tic Tac Toe game with Working AI This project will be created in Visual Studio 2010 however you can use any version of Visual Studio to follow along this tutorial. To start open

More information

Introduction to Microsoft.NET

Introduction to Microsoft.NET Introduction to Microsoft.NET.NET initiative Introduced by Microsoft (June 2000) Vision for embracing the Internet in software development Independence from specific language or platform Applications developed

More information

Microsoft Visual Basic 2005: Reloaded

Microsoft Visual Basic 2005: Reloaded Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 10 Creating Classes and Objects Objectives After studying this chapter, you should be able to: Define a class Instantiate an object from a class

More information

3 Welcome Application 41 Introduction to Visual Programming

3 Welcome Application 41 Introduction to Visual Programming CO N T E N T S Preface xvii 1 Graphing Application 1 Introducing Computers, the Internet and Visual Basic.NET 1.1 What Is a Computer? 1 1.2 Computer Organization 2 1.3 Machine Languages, Assembly Languages

More information

Quick Guide for the ServoWorks.NET API 2010/7/13

Quick Guide for the ServoWorks.NET API 2010/7/13 Quick Guide for the ServoWorks.NET API 2010/7/13 This document will guide you through creating a simple sample application that jogs axis 1 in a single direction using Soft Servo Systems ServoWorks.NET

More information

IBSDK Quick Start Tutorial for C# 2010

IBSDK Quick Start Tutorial for C# 2010 IB-SDK-00003 Ver. 3.0.0 2012-04-04 IBSDK Quick Start Tutorial for C# 2010 Copyright @2012, lntegrated Biometrics LLC. All Rights Reserved 1 QuickStart Project C# 2010 Example Follow these steps to setup

More information

Chapter 6 Dialogs. Creating a Dialog Style Form

Chapter 6 Dialogs. Creating a Dialog Style Form Chapter 6 Dialogs We all know the importance of dialogs in Windows applications. Dialogs using the.net FCL are very easy to implement if you already know how to use basic controls on forms. A dialog is

More information

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class.

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class. 1. What is C#? C# (pronounced "C sharp") is a simple, modern, object oriented, and type safe programming language. It will immediately be familiar to C and C++ programmers. C# combines the high productivity

More information

Operatii pop si push-stiva

Operatii pop si push-stiva Operatii pop si push-stiva Aplicatia realizata in Microsoft Visual Studio C++ 2010 permite simularea operatiilor de introducere si extragere a elementelor dintr-o structura de tip stiva.pentru aceasta

More information

Before You Begin 1 Graphing Application 1 Introducing Computers, the Internet and Visual Basic.NET

Before You Begin 1 Graphing Application 1 Introducing Computers, the Internet and Visual Basic.NET CO N T E N T S Preface Before You Begin xviii xxviii 1 Graphing Application 1 Introducing Computers, the Internet and Visual Basic.NET 1.1 What Is a Computer? 1 1.2 Computer Organization 2 1.3 Machine

More information

Subject to Change Drawing Application 1 Introducing Computers, the Internet and C#

Subject to Change Drawing Application 1 Introducing Computers, the Internet and C# CO N T E N T S Subject to Change 08-01-2003 Preface Before You Begin Brief Table of Contents i iv vii 1 Drawing Application 1 Introducing Computers, the Internet and C# 1.1 What Is a Computer? 1 1.2 Computer

More information

Objectives. Introduce static keyword examine syntax describe common uses

Objectives. Introduce static keyword examine syntax describe common uses Static Objectives Introduce static keyword examine syntax describe common uses 2 Static Static represents something which is part of a type rather than part of an object Two uses of static field method

More information

PS2 Random Walk Simulator

PS2 Random Walk Simulator PS2 Random Walk Simulator Windows Forms Global data using Singletons ArrayList for storing objects Serialization to Files XML Timers Animation This is a fairly extensive Problem Set with several new concepts.

More information

Click on the empty form and apply the following options to the properties Windows.

Click on the empty form and apply the following options to the properties Windows. Start New Project In Visual Studio Choose C# Windows Form Application Name it SpaceInvaders and Click OK. Click on the empty form and apply the following options to the properties Windows. This is the

More information

Blank Form. Industrial Programming. Discussion. First Form Code. Lecture 8: C# GUI Development

Blank Form. Industrial Programming. Discussion. First Form Code. Lecture 8: C# GUI Development Blank Form Industrial Programming Lecture 8: C# GUI Development Industrial Programming 1 Industrial Programming 2 First Form Code using System; using System.Drawing; using System.Windows.Forms; public

More information

Design-Time Integration

Design-Time Integration Sells.book Page 289 Thursday, August 7, 2003 9:51 AM 9 Design-Time Integration A COMPONENT IS A NONVISUAL CLASS designed specifically to integrate with a design-time environment such as Visual Studio.NET.

More information

UNIT-3. Prepared by R.VINODINI 1

UNIT-3. Prepared by R.VINODINI 1 Prepared by R.VINODINI 1 Prepared by R.VINODINI 2 Prepared by R.VINODINI 3 Prepared by R.VINODINI 4 Prepared by R.VINODINI 5 o o o o Prepared by R.VINODINI 6 Prepared by R.VINODINI 7 Prepared by R.VINODINI

More information

Form Properties Window

Form Properties Window C# Tutorial Create a Save The Eggs Item Drop Game in Visual Studio Start Visual Studio, Start a new project. Under the C# language, choose Windows Form Application. Name the project savetheeggs and click

More information

The Microsoft.NET Framework

The Microsoft.NET Framework Microsoft Visual Studio 2005/2008 and the.net Framework The Microsoft.NET Framework The Common Language Runtime Common Language Specification Programming Languages C#, Visual Basic, C++, lots of others

More information

Laboratorio di Ingegneria del Software

Laboratorio di Ingegneria del Software Laboratorio di Ingegneria del Software L-A Interfaccia utente System.Windows.Forms The System.Windows.Forms namespace contains classes for creating Windows-based applications The classes can be grouped

More information

Laboratorio di Ingegneria del L-A

Laboratorio di Ingegneria del L-A Software L-A Interfaccia utente System.Windows.Forms The System.Windows.Forms namespace contains classes for creating Windows-based applications The classes can be grouped into the following categories:

More information

Create your own Meme Maker in C#

Create your own Meme Maker in C# Create your own Meme Maker in C# This tutorial will show how to create a meme maker in visual studio 2010 using C#. Now we are using Visual Studio 2010 version you can use any and still get the same result.

More information

Event-based Programming

Event-based Programming Window-based programming Roger Crawfis Most modern desktop systems are window-based. What location do I use to set this pixel? Non-window based environment Window based environment Window-based GUI s are

More information

Chapter 12: How to Create and Use Classes

Chapter 12: How to Create and Use Classes CIS 260 C# Chapter 12: How to Create and Use Classes 1. An Introduction to Classes 1.1. How classes can be used to structure an application A class is a template to define objects with their properties

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

Instructions for Crossword Assignment CS130

Instructions for Crossword Assignment CS130 Instructions for Crossword Assignment CS130 Purposes: Implement a keyboard interface. 1. The program you will build is meant to assist a person in preparing a crossword puzzle for publication. You have

More information

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock.

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock. C# Tutorial - Create a YouTube Alarm Clock in Visual Studio In this tutorial we will create a simple yet elegant YouTube alarm clock in Visual Studio using C# programming language. The main idea for this

More information

Standard. Number of Correlations

Standard. Number of Correlations Computer Science 2016 This assessment contains 80 items, but only 80 are used at one time. Programming and Software Development Number of Correlations Standard Type Standard 2 Duty 1) CONTENT STANDARD

More information

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at: This document describes how to create a simple Windows Forms Application using some Open Core Interface functions in C# with Microsoft Visual Studio Express 2013. 1 Preconditions The Open Core Interface

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

And Even More and More C++ Fundamentals of Computer Science

And Even More and More C++ Fundamentals of Computer Science And Even More and More C++ Fundamentals of Computer Science Outline C++ Classes Special Members Friendship Classes are an expanded version of data structures (structs) Like structs, the hold data members

More information

2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET

2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET 2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET Introduction Elements of this syllabus are subject to change. This five-day instructor-led course provides students with the knowledge

More information

More Language Features and Windows Forms. Part I. Some Language Features. Inheritance. Inheritance. Inheritance. Inheritance.

More Language Features and Windows Forms. Part I. Some Language Features. Inheritance. Inheritance. Inheritance. Inheritance. More Language Features and Windows Forms C# Programming Part I Some Language Features January 12 To extend a class A: class B : A { B inherits all instance variables and methods of A Which ones it can

More information

Class 15. Object-Oriented Development from Structs to Classes. Laura Marik Spring 2012 C++ Course Notes (Provided by Jason Minski)

Class 15. Object-Oriented Development from Structs to Classes. Laura Marik Spring 2012 C++ Course Notes (Provided by Jason Minski) Class 15 Object-Oriented Development from Structs to Classes The difference between structs and classes A class in C++ is basically the same thing as a struct The following are exactly equivalent struct

More information

More Language Features and Windows Forms

More Language Features and Windows Forms More Language Features and Windows Forms C# Programming January 12 Part I Some Language Features Inheritance To extend a class A: class B : A {... } B inherits all instance variables and methods of A Which

More information

Advanced Object-Oriented Programming. 11 Features. C# Programming: From Problem Analysis to Program Design. 4th Edition

Advanced Object-Oriented Programming. 11 Features. C# Programming: From Problem Analysis to Program Design. 4th Edition 11 Features Advanced Object-Oriented Programming C# Programming: From Problem Analysis to Program Design C# Programming: From Problem Analysis to Program Design 1 4th Edition Chapter Objectives Learn the

More information

OGSI.NET UVa Grid Computing Group. OGSI.NET Developer Tutorial

OGSI.NET UVa Grid Computing Group. OGSI.NET Developer Tutorial OGSI.NET UVa Grid Computing Group OGSI.NET Developer Tutorial Table of Contents Table of Contents...2 Introduction...3 Writing a Simple Service...4 Simple Math Port Type...4 Simple Math Service and Bindings...7

More information

CHAPTER 3. Writing Windows C# Programs. Objects in C#

CHAPTER 3. Writing Windows C# Programs. Objects in C# 90 01 pp. 001-09 r5ah.ps 8/1/0 :5 PM Page 9 CHAPTER 3 Writing Windows C# Programs 5 9 Objects in C# The C# language has its roots in C++, Visual Basic, and Java. Both C# and VB.Net use the same libraries

More information

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College The string Class Lecture 21 Sections 2.9, 3.9, 3.10 Robb T. Koether Hampden-Sydney College Wed, Oct 17, 2018 Robb T. Koether (Hampden-Sydney College) The string Class Wed, Oct 17, 2018 1 / 18 1 The String

More information

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch Problem Solving Creating a class from scratch 1 Recipe for Writing a Class 1. Write the class boilerplate stuff 2. Declare Fields 3. Write Creator(s) 4. Write accessor methods 5. Write mutator methods

More information

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How to Download a File in the Background 15 How to Implement

More information

Conventions in this tutorial

Conventions in this tutorial This document provides an exercise using Digi JumpStart for Windows Embedded CE 6.0. This document shows how to develop, run, and debug a simple application on your target hardware platform. This tutorial

More information

Software Design and Analysis for Engineers

Software Design and Analysis for Engineers Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 2 Date:

More information

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor. 3.Constructors and Destructors Develop cpp program to implement constructor and destructor. Constructors A constructor is a special member function whose task is to initialize the objects of its class.

More information

Welcome Back. CSCI 262 Data Structures. Hello, Let s Review. Hello, Let s Review. How to Review 1/9/ Review. Here s a simple C++ program:

Welcome Back. CSCI 262 Data Structures. Hello, Let s Review. Hello, Let s Review. How to Review 1/9/ Review. Here s a simple C++ program: Welcome Back CSCI 262 Data Structures 2 - Review What you learned in CSCI 261 (or equivalent): Variables Types Arrays Expressions Conditionals Branches & Loops Functions Recursion Classes & Objects Streams

More information

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime Intro C# Intro C# 1 Microsoft's.NET platform and Framework.NET Enterprise Servers Visual Studio.NET.NET Framework.NET Building Block Services Operating system on servers, desktop, and devices Web Services

More information

XNA 4.0 RPG Tutorials. Part 11b. Game Editors

XNA 4.0 RPG Tutorials. Part 11b. Game Editors XNA 4.0 RPG Tutorials Part 11b Game Editors I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials on

More information

Chapter 12. OOP: Creating Object-Oriented Programs The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 12. OOP: Creating Object-Oriented Programs The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Chapter 12 OOP: Creating Object-Oriented Programs McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter Objectives - 1 Use object-oriented terminology correctly Create a two-tier

More information

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer C# Tutorial Create a Motivational Quotes Viewer Application in Visual Studio In this tutorial we will create a fun little application for Microsoft Windows using Visual Studio. You can use any version

More information

Objects and Classes Continued. Engineering 1D04, Teaching Session 10

Objects and Classes Continued. Engineering 1D04, Teaching Session 10 Objects and Classes Continued Engineering 1D04, Teaching Session 10 Recap: HighScores Example txtname1 txtname2 txtscore1 txtscore2 Copyright 2006 David Das, Ryan Lortie, Alan Wassyng 1 recap: HighScores

More information

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN Contents Contents 5 About the Author 12 Introduction 13 Conventions used in this book 14 1 The Visual Studio C# Environment 15 1.1 Introduction 15 1.2 Obtaining the C# software 15 1.3 The Visual Studio

More information

Object Oriented Programming COP3330 / CGS5409

Object Oriented Programming COP3330 / CGS5409 Object Oriented Programming COP3330 / CGS5409 Classes & Objects DDU Design Constructors Member Functions & Data Friends and member functions Const modifier Destructors Object -- an encapsulation of data

More information

Avoiding KeyStrokes in Windows Applications using C#

Avoiding KeyStrokes in Windows Applications using C# Avoiding KeyStrokes in Windows Applications using C# In keeping with the bcrypt.exe example cited elsewhere on this site, we seek a method of avoiding using the keypad to enter pass words and/or phrases.

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming 1. What is object-oriented programming (OOP)? OOP is a technique to develop logical modules, such as classes that contain properties, methods, fields, and events. An object

More information

EL-USB-RT API Guide V1.0

EL-USB-RT API Guide V1.0 EL-USB-RT API Guide V1.0 Contents 1 Introduction 2 C++ Sample Dialog Application 3 C++ Sample Observer Pattern Application 4 C# Sample Application 4.1 Capturing USB Device Connect \ Disconnect Events 5

More information

Using the Quinn-Curtis.Net Software (QCChart2D and QCRTGraph) with Managed C++ (MC++)

Using the Quinn-Curtis.Net Software (QCChart2D and QCRTGraph) with Managed C++ (MC++) Using the Quinn-Curtis Net Software (QCChart2D and QCRTGraph) with Managed C++ (MC++) August 9, 2005 Starting with Visual Studio 2003, you can create a Managed C++ application that interfaces to the Quinn-Curtis

More information

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET VB.NET Module 1: Getting Started This module introduces Visual Basic.NET and explains how it fits into the.net platform. It explains how to use the programming tools in Microsoft Visual Studio.NET and

More information

Variables. Data Types.

Variables. Data Types. Variables. Data Types. The usefulness of the "Hello World" programs shown in the previous section is quite questionable. We had to write several lines of code, compile them, and then execute the resulting

More information

Final Exam Review April 18, 2018

Final Exam Review April 18, 2018 Engr 123 Name Final Exam Review April 18, 2018 Final Exam is Monday April 30, 2018 at 8:00am 1. If i, j, and k are all of type int and i = 0, j = 2, and k = -8, mark whether each of the following logical

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

INFORMATICS LABORATORY WORK #4

INFORMATICS LABORATORY WORK #4 KHARKIV NATIONAL UNIVERSITY OF RADIO ELECTRONICS INFORMATICS LABORATORY WORK #4 MAZE GAME CREATION Associate Professor A.S. Eremenko, Associate Professor A.V. Persikov Maze In this lab, you build a maze

More information

JScript Reference. Contents

JScript Reference. Contents JScript Reference Contents Exploring the JScript Language JScript Example Altium Designer and Borland Delphi Run Time Libraries Server Processes JScript Source Files PRJSCR, JS and DFM files About JScript

More information