// Precondition: None // Postcondition: The address' name has been set to the // specified value set;

Size: px
Start display at page:

Download "// Precondition: None // Postcondition: The address' name has been set to the // specified value set;"

Transcription

1 // File: Address.cs // This classes stores a typical US address consisting of name, // two address lines, city, state, and 5 digit zip code. using System; using System.Collections.Generic; using System.Linq; using System.Text; [Serializable] public class Address public const int MIN_ZIP = 0; // Minimum ZipCode value public const int MAX_ZIP = 99999; // Maximum ZipCode value private int zip; // Address' zip code // Precondition: MIN_ZIP <= zipcode <= MAX_ZIP // Postcondition: The address is created with the specified values for // name, address1, address2, city, state, and zipcode public Address(String name, String address1, String address2, String city, String state, int zipcode) Name = name; Address1 = address1; Address2 = address2; City = city; State = state; Zip = zipcode; public String Name // Postcondition: The address' name has been returned ; // Postcondition: The address' name has been set to the set; public String Address1 // Postcondition: The address' first address line has been returned ; // Postcondition: The address' first address line has been set to // the specified value set; public String Address2

2 // Postcondition: The address' second address line has been returned ; // Postcondition: The address' second address line has been set to // the specified value set; public String City // Postcondition: The address' city has been returned ; // Postcondition: The address' city has been set to the set; public String State // Postcondition: The address' state has been returned ; // Postcondition: The address' state has been set to the set; public int Zip // Postcondition: The address' zip code has been returned return zip; // Precondition: MIN_ZIP <= value <= MAX_ZIP // Postcondition: The address' zip code has been set to the set if ((value >= MIN_ZIP) && (value <= MAX_ZIP)) zip = value; else throw new ArgumentOutOfRangeException("ZIP", value, "ZIP must be U.S. 5 digit zip code"); // Postcondition: A String with the address' data has been returned public override String ToString()

3 if (String.IsNullOrWhiteSpace(Address2)) // Is Address2 empty? return String.Format("05152, 3 4:D5", Name, Address1, City, State, Zip, Environment.NewLine); else return String.Format(" , 4 5:D5", Name, Address1, Address2, City, State, Zip, Environment.NewLine); // File: AirPackage.cs

4 // The AirPackage class is an abstract derived class from Package. It is able // to determine if the package is heavy or large. using System; using System.Collections.Generic; using System.Linq; using System.Text; [Serializable] public abstract class AirPackage : Package public const double HEAVY_THRESHOLD = 75; // Min weight of heavy package public const double LARGE_THRESHOLD = 100; // Min dimensions of large package // Precondition: plength > 0, pwidth > 0, pheight > 0, // pweight > 0 // Postcondition: The air package is created with the specified values for // origin address, destination address, length, width, // height, and weight public AirPackage(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight) : base(originaddress, destaddress, plength, pwidth, pheight, pweight) // All work done in base class constructor // Postcondition: Returns true if air package is considered heavy // else returns false public bool IsHeavy() return (Weight >= HEAVY_THRESHOLD); // Postcondition: Returns true if air package is considered large // else returns false public bool IsLarge() return (TotalDimension >= LARGE_THRESHOLD); // Postcondition: A String with the air package's data has been returned public override string ToString() string NL = Environment.NewLine; // Newline shorthand return $"Airbase.ToString()NLIsHeavy: IsHeavy()NLIsLarge: IsLarge()";

5 // File: GroundPackage.cs // The Package class is a concrete derived class from Package. It adds // a Zone Distance. using System; using System.Collections.Generic; using System.Linq; using System.Text; [Serializable] public class GroundPackage : Package // Precondition: plength > 0, pwidth > 0, pheight > 0, // pweight > 0 // Postcondition: The ground package is created with the specified values for // origin address, destination address, length, width, // height, and weight public GroundPackage(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight) : base(originaddress, destaddress, plength, pwidth, pheight, pweight) // All work done in base class constructor public int ZoneDistance // Postcondition: The ground package's zone distance is returned. // The zone distance is the positive difference between the // first digit of the origin address' zip code and the first // digit of the destination address' zip code. const int FIRST_DIGIT_FACTOR = 10000; // Denominator to extract 1st digit int dist; // Calculated zone distance dist = Math.Abs((OriginAddress.Zip / FIRST_DIGIT_FACTOR) - (DestinationAddress.Zip / FIRST_DIGIT_FACTOR)); return dist; // Postcondition: The ground package's cost has been returned public override decimal CalcCost() const double DIM_FACTOR =.20; // Dimension coefficient in cost equation const double WEIGHT_FACTOR =.05; // Weight coefficient in cost equation return (decimal)(dim_factor * TotalDimension + WEIGHT_FACTOR * (ZoneDistance + 1) * Weight); // Postcondition: A String with the ground package's data has been returned public override string ToString()

6 string NL = Environment.NewLine; // Newline shorthand return $"Groundbase.ToString()NLZone Distance: ZoneDistance:D"; // File: Letter.cs // The Letter class is a concrete derived class of Parcel. Letters // have a fixed cost. using System; using System.Collections.Generic; using System.Linq; using System.Text; [Serializable] public class Letter : Parcel private decimal fixedcost; // Cost to send letter // Precondition: cost >= 0 // Postcondition: The letter is created with the specified values for // origin address, destination address, and cost public Letter(Address originaddress, Address destaddress, decimal cost) : base(originaddress, destaddress) FixedCost = cost; private decimal FixedCost // Helper property // Postcondition: The letter's fixed cost has been returned return fixedcost; // Precondition: value >= 0 // Postcondition: The letter's fixed cost has been set to the set if (value >= 0) fixedcost = value; else throw new ArgumentOutOfRangeException("FixedCost", value, "FixedCost must be >= 0");

7 // Postcondition: The letter's cost has been returned public override decimal CalcCost() return FixedCost; // Postcondition: A String with the letter's data has been returned public override string ToString() return $"LetterEnvironment.NewLinebase.ToString()"; // File: NextDayAirPackage.cs // The NextDayAirPackage class is a concrete derived class from AirPackage. It adds // an express fee. using System; using System.Collections.Generic; using System.Linq; using System.Text; [Serializable] public class NextDayAirPackage : AirPackage private decimal expressfee; // Next day air package's express fee // Precondition: plength > 0, pwidth > 0, pheight > 0,

8 // pweight > 0, expfee >= 0 // Postcondition: The next day air package is created with the specified values for // origin address, destination address, length, width, // height, weight, and express fee public NextDayAirPackage(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight, decimal expfee) : base(originaddress, destaddress, plength, pwidth, pheight, pweight) ExpressFee = expfee; public decimal ExpressFee // Postcondition: The next day air package's express fee has been returned return expressfee; // Precondition: value >= 0 // Postcondition: The next day air package's express fee has been set to the private set // Helper set property if (value >= 0) expressfee = value; else throw new ArgumentOutOfRangeException("ExpressFee", value, "ExpressFee must be >= 0"); // Postcondition: The next day air package's cost has been returned public override decimal CalcCost() const double DIM_FACTOR =.40; // Dimension coefficient in cost equation const double WEIGHT_FACTOR =.30; // Weight coefficient in cost equation const double HEAVY_FACTOR =.25; // Heavy coefficient in cost equation const double LARGE_FACTOR =.25; // Large coefficient in cost equation decimal cost; // Running total of cost of package cost = (decimal)(dim_factor * TotalDimension + WEIGHT_FACTOR * Weight) + ExpressFee; if (IsHeavy()) cost += (decimal)(heavy_factor * Weight); if (IsLarge()) cost += (decimal)(large_factor * TotalDimension); return cost; // Postcondition: A String with the next day air package's data has been returned public override string ToString()

9 string NL = Environment.NewLine; // Newline shorthand return $"NextDaybase.ToString()NLExpress Fee: ExpressFee:C"; // File: Package.cs // The Package class is an abstract derived class from Parcel. It adds // dimensions and weight. using System; using System.Collections.Generic; using System.Linq; using System.Text; [Serializable] public abstract class Package : Parcel private double length; // Length of package in inches private double width; // Width of package in inches private double height; // Height of package in inches private double weight; // Weight of package in pounds // Precondition: plength > 0, pwidth > 0, pheight > 0, // pweight > 0 // Postcondition: The package is created with the specified values for // origin address, destination address, length, width, // height, and weight public Package(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight) : base(originaddress, destaddress) Length = plength; Width = pwidth; Height = pheight; Weight = pweight; public double Length // Postcondition: The package's length has been returned return length; // Precondition: value > 0 // Postcondition: The package's length has been set to the set

10 if (value > 0) length = value; else throw new ArgumentOutOfRangeException("Length", value, "Length must be > 0"); public double Width // Postcondition: The package's width has been returned return width; // Precondition: value > 0 // Postcondition: The package's width has been set to the set if (value > 0) width = value; else throw new ArgumentOutOfRangeException("Width", value, "Width must be > 0"); public double Height // Postcondition: The package's height has been returned return height; // Precondition: value > 0 // Postcondition: The package's height has been set to the set if (value > 0) height = value; else throw new ArgumentOutOfRangeException("Height", value, "Height must be > 0"); public double Weight // Postcondition: The package's weight has been returned

11 return weight; // Precondition: value > 0 // Postcondition: The package's weight has been set to the set if (value > 0) weight = value; else throw new ArgumentOutOfRangeException("Weight", value, "Weight must be > 0"); // Helper Property protected double TotalDimension // Postcondition: The package's (Length + Width + Height) is returned return (Length + Width + Height); // Postcondition: A String with the package's data has been returned public override string ToString() string NL = Environment.NewLine; // Newline shorthand return $"PackageNLbase.ToString()NLLength: Length:N1NLWidth: Width:N1NL" + $"Height: Height:N1NLWeight: Weight:N1"; // File: Parcel.cs // Parcel serves as the abstract base class of the Parcel hierachy. using System; using System.Collections.Generic; using System.Linq; using System.Text; [Serializable] public abstract class Parcel // Postcondition: The parcel is created with the specified values for

12 // origin address and destination address public Parcel(Address originaddress, Address destaddress) OriginAddress = originaddress; DestinationAddress = destaddress; public Address OriginAddress // Postcondition: The parcel's origin address has been returned ; // Postcondition: The parcel's origin address has been set to the set; public Address DestinationAddress // Postcondition: The parcel's destination address has been returned ; // Postcondition: The parcel's destination address has been set to the set; // Postcondition: The parcel's cost has been returned public abstract decimal CalcCost(); // Postcondition: A String with the parcel's data has been returned public override String ToString() return String.Format("Origin Address:3033Destination Address:313Cost: 2:C", OriginAddress, DestinationAddress, CalcCost(), Environment.NewLine); // File: TwoDayAirPackage.cs // The TwoDayAirPackage class is a concrete derived class from AirPackage. It adds // a delivery type. using System; using System.Collections.Generic; using System.Linq; using System.Text;

13 [Serializable] public class TwoDayAirPackage : AirPackage public enum Delivery Early, Saver ; // Delivery types // Precondition: plength > 0, pwidth > 0, pheight > 0, // pweight > 0 // Postcondition: The two day air package is created with the specified values for // origin address, destination address, length, width, // height, weight, and delivery type public TwoDayAirPackage(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight, Delivery deltype) : base(originaddress, destaddress, plength, pwidth, pheight, pweight) DeliveryType = deltype; public Delivery DeliveryType // Postcondition: The two day air package's delivery type has been returned ; // Postcondition: The two day air package's delivery type has been set to the set; // Postcondition: The two day air package's cost has been returned public override decimal CalcCost() const double DIM_FACTOR =.25; // Dimension coefficient in cost equation const double WEIGHT_FACTOR =.25; // Weight coefficient in cost equation const decimal DISCOUNT_FACTOR = 0.10M; // Discount factor in cost equation decimal cost; // Running total of cost of package cost = (decimal)(dim_factor * TotalDimension + WEIGHT_FACTOR * Weight); if (DeliveryType == Delivery.Saver) cost *= (1-DISCOUNT_FACTOR); return cost; // Postcondition: A String with the two day air package's data has been returned public override string ToString() string NL = Environment.NewLine; // Newline shorthand return $"TwoDaybase.ToString()NLDelivery Type: DeliveryType";

14 // File: UserParcelView.cs // The user parcel view manages the business logic and will be used by the Windows Forms application // to accomplish the general functionality. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UPVApp [Serializable] public class UserParcelView // Namespace Accessible Data - Use with care internal List<Address> addresses; // List of addresses stored for this user internal List<Parcel> parcels; // List of parcels for this user // Postcondition: The view has been created and is empty (no addresses, no parcels) public UserParcelView() addresses = new List<Address>(); parcels = new List<Parcel>(); // Precondition: Address.MIN_ZIP <= zipcode <= Address.MAX_ZIP // Postcondition: An Address with the specified values has been created // and added to the UserParcelView. public void AddAddress(String name, String address1, String address2, String city, String state, int zipcode) Address a; // The address being added a = new Address(name, address1, address2, city, state, zipcode); addresses.add(a); // Precondition: cost >= 0 // Postcondition: A Letter with the specified values has been created // and added to the UserParcelView. public void AddLetter(Address originaddress, Address destaddress, decimal cost) Letter l; // The letter being added l = new Letter(originAddress, destaddress, cost);

15 parcels.add(l); // Precondition: plength > 0, pwidth > 0, pheight > 0, // pweight > 0 // Postcondition: A GroundPackage with the specified values has been created // and added to the UserParcelView. public void AddGroundPackage(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight) GroundPackage p; // The ground package being added p = new GroundPackage(originAddress, destaddress, plength, pwidth, pheight, pweight); parcels.add(p); expfee) // Precondition: plength > 0, pwidth > 0, pheight > 0, // pweight > 0, expfee >= 0 // Postcondition: A NextDayAirPackage with the specified values has been created // and added to the UserParcelView. public void AddNextDayAirPackage(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight, decimal NextDayAirPackage p; // The next day air package being added p = new NextDayAirPackage(originAddress, destaddress, plength, pwidth, pheight, pweight, expfee); parcels.add(p); // Precondition: plength > 0, pwidth > 0, pheight > 0, // pweight > 0 // Postcondition: A TwoDayAirPackage with the specified values has been created // and added to the UserParcelView. public void AddTwoDayAirPackage(Address originaddress, Address destaddress, double plength, double pwidth, double pheight, double pweight, TwoDayAirPackage.Delivery deltype) TwoDayAirPackage p; // The two day air package being added p = new TwoDayAirPackage(originAddress, destaddress, plength, pwidth, pheight, pweight, deltype); parcels.add(p); public int AddressCount // Postcondition: The number of addresses in the UserParcelView // is returned. return addresses.count;

16 public int ParcelCount // Postcondition: The number of parcels in the UserParcelView // is returned. return parcels.count; // Precondition: 0 <= index < AddressCount // Postcondition: The specified address is returned public Address AddressAt(int index) if ((index < 0) (index >= AddressCount)) throw new ArgumentOutOfRangeException("index", index, "Invalid index!"); return AddressList[index]; // Precondition: 0 <= index < ParcelCount // Postcondition: The specified address is returned public Parcel ParcelAt(int index) if ((index < 0) (index >= ParcelCount)) throw new ArgumentOutOfRangeException("index", index, "Invalid index!"); return ParcelList[index]; internal List<Address> AddressList // Namespace Helper property - Use with care // Postcondition: The list of addresses stored in the UserParcelView // is returned. return addresses; internal List<Parcel> ParcelList // Namespace Helper property - Use with care // Postcondition: The list of parcels stored in the UserParcelView // is returned. return parcels; // Postcondition: A string summary of the UserParcel View is returned. public override string ToString()

17 // Using StringBuilder to show use of a more efficient way than String concatenation StringBuilder result = new StringBuilder(); // Will hold result as being built string NL = Environment.NewLine; // Newline shorthand decimal totalcost = 0; // Running total of parcel costs foreach (Parcel p in ParcelList) totalcost += p.calccost(); result.append($"userparcelview Info:NL"); result.append($"number of Addresses stored: AddressCountNL"); result.append($"number of Parcels stored: ParcelCountNL"); result.append($"total cost of Parcels: totalcost:cnl"); return result.tostring(); // File: Prog3Form.cs // This class creates the main GUI for Program 3. It provides a // File menu with About, Open, Save As and Exit items, an Insert menu with Address and // Letter items, and a Report menu with List Addresses and List Parcels // items that can be updated. 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; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; namespace UPVApp public partial class Prog3Form : Form private BinaryFormatter formatter = new BinaryFormatter(); // object for serializing Addresses in Binary Format. private FileStream output; // stream for writing to a file private BinaryFormatter reader = new BinaryFormatter(); // object for deserializing Addresses in Binary Format;

18 private FileStream input; from a file private UserParcelView upv; // stream for reading // upv object are // Postcondition: The form's GUI is prepared for display. A few test addresses // added to the list of addresses public Prog3Form() InitializeComponent(); upv = new UserParcelView(); // Precondition: File, About menu item activated // Postcondition: Information about author displayed in dialog box private void abouttoolstripmenuitem_click(object sender, EventArgs e) string NL = Environment.NewLine; // Newline shorthand MessageBox.Show($"Program 2NLBy: Ndaw, Maam AwaNLCIS 200NLFall 2016", "About Program 2"); // Precondition: File, Exit menu item activated // Postcondition: The application is exited private void exittoolstripmenuitem_click(object sender, EventArgs e) Application.Exit(); // Precondition: Insert, Address menu item activated // Postcondition: The Address dialog box is displayed. If data entered // are OK, an Address is created and added to the list // of addresses private void addresstoolstripmenuitem_click(object sender, EventArgs e) AddressForm addressform = new AddressForm(); // The address dialog box form DialogResult result = addressform.showdialog(); // Show form as dialog and store result if (result == DialogResult.OK) // Only add if OK try upv.addaddress(addressform.addressname, addressform.address1, addressform.address2, addressform.city, addressform.state, int.parse(addressform.ziptext)); // Use form's properties to create address catch (FormatException) // This should never happen if form validation works!

19 Error"); MessageBox.Show("Problem with Address Validation!", "Validation addressform.dispose(); // Best practice for dialog boxes built than String // Precondition: Report, List Addresses menu item activated // Postcondition: The list of addresses is displayed in the addressresultstxt // text box private void listaddressestoolstripmenuitem_click(object sender, EventArgs e) StringBuilder result = new StringBuilder(); // Holds text as report being string NL = Environment.NewLine; // StringBuilder more efficient // Newline shorthand result.append("addresses:"); result.append(nl); // Remember, \n doesn't always work in GUIs result.append(nl); foreach (Address a in upv.addresslist) result.append(a.tostring()); result.append(nl); result.append(" "); result.append(nl); reporttxt.text = result.tostring(); // Put cursor at start of report reporttxt.focus(); reporttxt.selectionstart = 0; reporttxt.selectionlength = 0; // Precondition: Insert, Letter menu item activated // Postcondition: The Letter dialog box is displayed. If data entered // are OK, a Letter is created and added to the list // of parcels private void lettertoolstripmenuitem_click(object sender, EventArgs e) LetterForm letterform; // The letter dialog box form DialogResult result; // The result of showing form as dialog if (upv.addresscount < LetterForm.MIN_ADDRESSES) // Make sure we have enough addresses MessageBox.Show("Need " + LetterForm.MIN_ADDRESSES + " addresses to create letter!", "Addresses Error"); return; letterform = new LetterForm(upv.AddressList); // Send list of addresses

20 result = letterform.showdialog(); inserted works! Error"); if (result == DialogResult.OK) // Only add if OK try // For this to work, LetterForm's combo boxes need to be in same // order as upv's AddressList upv.addletter(upv.addressat(letterform.originaddressindex), upv.addressat(letterform.destinationaddressindex), decimal.parse(letterform.fixedcosttext)); // Letter to be catch (FormatException) // This should never happen if form validation MessageBox.Show("Problem with Letter Validation!", "Validation letterform.dispose(); // Best practice for dialog boxes built // Precondition: Report, List Parcels menu item activated // Postcondition: The list of parcels is displayed in the parcelresultstxt // text box private void listparcelstoolstripmenuitem_click(object sender, EventArgs e) StringBuilder result = new StringBuilder(); // Holds text as report being than String decimal totalcost = 0; shipping costs string NL = Environment.NewLine; // StringBuilder more efficient // Running total of parcel // Newline shorthand result.append("parcels:"); result.append(nl); // Remember, \n doesn't always work in GUIs result.append(nl); foreach (Parcel p in upv.parcellist) result.append(p.tostring()); result.append(nl); result.append(" "); result.append(nl); totalcost += p.calccost(); result.append(nl); result.append($"total Cost: totalcost:c"); reporttxt.text = result.tostring(); // Put cursor at start of report reporttxt.focus(); reporttxt.selectionstart = 0;

21 reporttxt.selectionlength = 0; // Precondition: File, Open menu item activated // Postcondition: File Opened private void opentoolstripmenuitem_click(object sender, EventArgs e) DialogResult result; // result of OpenFileDialog string filename; // name of file containing data Box using (OpenFileDialog filechooser = new OpenFileDialog()) result = filechooser.showdialog(); // Retrieve the result of the dialog filename = filechooser.filename; // end using // Get specified file if (result == DialogResult.OK) if (filename!= string.empty) try input = new FileStream(fileName, FileMode.Open, FileAccess.Read); // Create FileStream to obtain read access to file upv = (UserParcelView)reader.Deserialize(input); // Get next record serializable available in file. // end try // Handle exception when there are no Addresses in file catch (SerializationException) MessageBox.Show("Error reading from file", string.empty, MessageBoxButtons.OK, MessageBoxIcon.Information); // end catch // Finally block finally if (input!= null) input.close(); // input not null // Close FileStreaam // Precondition: File, Save As menu item activated // Postcondition: File Saved private void saveastoolstripmenuitem_click(object sender, EventArgs e) //create and show dialog box enabling user to save file DialogResult result; // The result of showing form as dialog string filename; // name of the file name to save data using (SaveFileDialog filechooser = new SaveFileDialog())

22 Box filechooser.checkfileexists = false; // Let user create file. result = filechooser.showdialog(); // Retrieve the result of the dialog filename = filechooser.filename; // end using // Get specified file name FileAccess.Write); // Only add if ok if (result == DialogResult.OK) // Checks if not empty file name if (filename!= string.empty) try output = new FileStream(fileName, FileMode.Create, // Open file with write access formatter.serialize(output, upv); // write Address to FileStream (Serialize object) // end try // Exception handling if there's a problem opening the file catch (IOException) MessageBox.Show("Error opening file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // end catch // Notify user if error occurs in serialization catch ( SerializationException) MessageBox.Show("Error writing to file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // end catch // Finally block finally if (output!= null) output.close(); // Output not null // Close FileStreaam // Precondition: Edit Address is selected // Postcondition: ChooseAddressForm displays, allows user to select address to edit // when user presses ok, addressform display prepopulated with address data. private void addresstoolstripmenuitem1_click(object sender, EventArgs e) ChooseAddressForm editaddress = new ChooseAddressForm(upv.AddressList); // The Choose Address dialog box form DialogResult result = editaddress.showdialog(); // The result of showing form as dialog

23 int editaddressindex; // To hold address indexes for editing if (upv.addresscount < ChooseAddressForm.MIN_ADDRESSES) // Make sure at least 1 address is selected MessageBox.Show("Need at least " + ChooseAddressForm.MIN_ADDRESSES + " address to edit!", "Addresses Error"); return; if (result == DialogResult.OK) // Only add if OK editaddressindex = editaddress.chooseaddress; // Variable to hold selected address index AddressForm editaddressform = new AddressForm(); // EditAddressForm calls a new address form Address address = upv.addressat(editaddressindex); // Variable to hold address object // To pre-populate Address Form editaddressform.addressname = address.name; // Address Name editaddressform.address1 = address.address1; // Address 1 editaddressform.address2 = address.address2; // Address 2 editaddressform.city = address.city; // City editaddressform.state = address.state; // State editaddressform.ziptext = address.zip.tostring("d5"); // Zip result = editaddressform.showdialog(); result on Address Form Dialog Box // Displays variable Name if (result == DialogResult.OK) // Only add if OK try // To Set data in address fields from Address Form for each address.name = editaddressform.addressname; // Address address.address1 = editaddressform.address1; // Address 1 address.address2 = editaddressform.address2; // Address 2 address.city = editaddressform.city; // City address.state = editaddressform.state; // State address.zip = int.parse(editaddressform.ziptext); // Zip // Exception handling if there's a problem edit addresses catch (IOException) MessageBox.Show("Error editing address", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // end catch

24 editaddress.dispose(); // Best practice for dialog boxes

// Program 2 - Extra Credit // CIS // Spring // Due: 3/11/2015. // By: Andrew L. Wright. //Edited by : Ben Spalding

// Program 2 - Extra Credit // CIS // Spring // Due: 3/11/2015. // By: Andrew L. Wright. //Edited by : Ben Spalding // Program 2 - Extra Credit // CIS 200-01 // Spring 2015 // Due: 3/11/2015 // By: Andrew L. Wright //Edited by : Ben Spalding // File: Prog2Form.cs // This class creates the main GUI for Program 2. It

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

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

Chapter 8 Advanced GUI Features

Chapter 8 Advanced GUI Features 159 Chapter 8 Advanced GUI Features There are many other features we can easily add to a Windows C# application. We must be able to have menus and dialogs along with many other controls. One workhorse

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

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued XNA 4.0 RPG Tutorials Part 24 Level Editor Continued 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

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

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

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

Eyes of the Dragon - XNA Part 37 Map Editor Revisited

Eyes of the Dragon - XNA Part 37 Map Editor Revisited Eyes of the Dragon - XNA Part 37 Map Editor Revisited I'm writing these tutorials for the XNA 4.0 framework. Even though Microsoft has ended support for XNA it still runs on all supported operating systems

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

Using Template Bookmarks for Automating Microsoft Word Reports

Using Template Bookmarks for Automating Microsoft Word Reports Using Template Bookmarks for Automating Microsoft Word Reports Darryl Bryk U.S. Army RDECOM-TARDEC Warren, MI 48397 Disclaimer: Reference herein to any specific commercial company, product, process, or

More information

Answer on Question# Programming, C#

Answer on Question# Programming, C# Answer on Question#38723 - Programming, C# 1. The development team of SoftSols Inc. has revamped the software according to the requirements of FlyHigh Airlines and is in the process of testing the software.

More information

Object oriented lab /second year / review/lecturer: yasmin maki

Object oriented lab /second year / review/lecturer: yasmin maki 1) Examples of method (function): Note: the declaration of any method is : method name ( parameters list ).. Method body.. Access modifier : public,protected, private. Return

More information

In-Class Worksheet #4

In-Class Worksheet #4 CSE 459.24 Programming in C# Richard Kidwell In-Class Worksheet #4 Creating a Windows Forms application with Data Binding You should have Visual Studio 2008 open. 1. Create a new Project either from the

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

Writing Your First Autodesk Revit Model Review Plug-In

Writing Your First Autodesk Revit Model Review Plug-In Writing Your First Autodesk Revit Model Review Plug-In R. Robert Bell Sparling CP5880 The Revit Model Review plug-in is a great tool for checking a Revit model for matching the standards your company has

More information

UNIVERSITY OF THE FREE STATE MAIN & QWA-QWA CAMPUS RIS 124 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER:

UNIVERSITY OF THE FREE STATE MAIN & QWA-QWA CAMPUS RIS 124 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER: UNIVERSITY OF THE FREE STATE MAIN & QWA-QWA CAMPUS RIS 124 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER: 4012754 EXAMINATION: Main End-of-year Examination 2013 PAPER 1 ASSESSORS: Prof. P.J.

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

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button Create an Interest Calculator with C# In This tutorial we will create an interest calculator in Visual Studio using C# programming Language. Programming is all about maths now we don t need to know every

More information

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below. APPENDIX 1 TABLE DETAILS Mainly three tables namely Teacher, Student and Class for small database of a school are used. The snapshots of all three tables are shown below. Details of Class table are shown

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

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) )

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) insert into bolumler values(1,'elektrik') insert into bolumler values(2,'makina') insert into bolumler

More information

} } public void getir() { DataTable dt = vt.dtgetir("select* from stok order by stokadi");

} } public void getir() { DataTable dt = vt.dtgetir(select* from stok order by stokadi); Form1 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

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 12 Visual Basic/C# Programming (330) REGIONAL 2017 Production Portion: Program 1: Calendar Analysis (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores

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

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

Appendix A Programkod

Appendix A Programkod Appendix A Programkod ProgramForm.cs using System; using System.Text; using System.Windows.Forms; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Collections.Generic;

More information

Lecture 8 Building an MDI Application

Lecture 8 Building an MDI Application Lecture 8 Building an MDI Application Introduction The MDI (Multiple Document Interface) provides a way to display multiple (child) windows forms inside a single main(parent) windows form. In this example

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

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

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

Representing Recursive Relationships Using REP++ TreeView

Representing Recursive Relationships Using REP++ TreeView Representing Recursive Relationships Using REP++ TreeView Author(s): R&D Department Publication date: May 4, 2006 Revision date: May 2010 2010 Consyst SQL Inc. All rights reserved. Representing Recursive

More information

Windows File I/O. Files. Collections of related data stored on external storage media and assigned names so that they can be accessed later

Windows File I/O. Files. Collections of related data stored on external storage media and assigned names so that they can be accessed later Windows File I/O Files Collections of related data stored on external storage media and assigned names so that they can be accessed later Entire collection is a file A file is made up of records One record

More information

LAMPIRAN A : LISTING PROGRAM

LAMPIRAN A : LISTING PROGRAM LAMPIRAN A : LISTING PROGRAM 1. Form Utama (Cover) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

More information

A Pattern for Storing Structured Data in AutoCAD Entities

A Pattern for Storing Structured Data in AutoCAD Entities A Pattern for Storing Structured Data in AutoCAD Entities Jeffery Geer RCM Technologies CP401-2 Xrecords provide storage of information in AutoCAD entities, but defining that structure can be a cumbersome

More information

For this example, we will set up a small program to display a picture menu for a fast food take-away shop.

For this example, we will set up a small program to display a picture menu for a fast food take-away shop. 146 Programming with C#.NET 9 Fast Food This program introduces the technique for uploading picture images to a C# program and storing them in a database table, in a similar way to text or numeric data.

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

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

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

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

if (say==0) { k.commandtext = Insert into kullanici(k_adi,sifre) values(' + textbox3.text + ',' + textbox4.text + '); k. 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; using System.Data.SqlClient;

More information

XNA 4.0 RPG Tutorials. Part 25. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 25. Level Editor Continued XNA 4.0 RPG Tutorials Part 25 Level Editor Continued 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

More information

Huw Talliss Data Structures and Variables. Variables

Huw Talliss Data Structures and Variables. Variables Data Structures and Variables Variables The Regex class represents a read-only regular expression. It also contains static methods that allow use of other regular expression classes without explicitly

More information

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); 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; using Edidev.FrameworkEDI;

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

CSC 415 ONLINE PHOTOALBUM: THE SEQUEL ASP.NET VERSION

CSC 415 ONLINE PHOTOALBUM: THE SEQUEL ASP.NET VERSION CSC 415 ONLINE PHOTOALBUM: THE SEQUEL ASP.NET VERSION GODFREY MUGANDA In this project, you will convert the Online Photo Album project to run on the ASP.NET platform, using only generic HTTP handlers.

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

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1 UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1 DATE: 12 March 2014 TIME: 4 hours MARKS: 220 ASSESSORS: Prof. P.J. Blignaut & Mr G.J. Dollman BONUS MARKS:

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 16 Visual Basic/C# Programming (330) REGIONAL 2016 Program: Character Stats (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores and answer keys! Property

More information

Topic 7: Algebraic Data Types

Topic 7: Algebraic Data Types Topic 7: Algebraic Data Types 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 5.5, 5.7, 5.8, 5.10, 5.11, 5.12, 5.14 14.4, 14.5, 14.6 14.9, 14.11,

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

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

emkt Browserless Coding For C#.Net and Excel

emkt Browserless Coding For C#.Net and Excel emkt Browserless Coding For C#.Net and Excel Browserless Basic Instructions and Sample Code 7/23/2013 Table of Contents Using Excel... 3 Configuring Excel for sending XML to emkt... 3 Sandbox instructions

More information

EEE-448 COMPUTER NETWORKS (Programming) Week -6 C# & IP Programming. The StringBuilder Class. StringBuilder Classes. StringBuilder with Append

EEE-448 COMPUTER NETWORKS (Programming) Week -6 C# & IP Programming. The StringBuilder Class. StringBuilder Classes. StringBuilder with Append EEE-448 COMPUTER NETWORKS (Programming) Week -6 C# & IP Programming Turgay IBRIKCI, PhD EEE448 Computer Networks Spring 2011 EEE448 Computer Networks Spring 2011 The StringBuilder Class The StringBuilder

More information

Developing for Mobile Devices Lab (Part 1 of 2)

Developing for Mobile Devices Lab (Part 1 of 2) Developing for Mobile Devices Lab (Part 1 of 2) Overview Through these two lab sessions you will learn how to create mobile applications for Windows Mobile phones and PDAs. As developing for Windows Mobile

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

ENGR/CS 101 CS Session Lecture 13

ENGR/CS 101 CS Session Lecture 13 ENGR/CS 101 CS Session Lecture 13 Log into Windows/ACENET (reboot if in Linux) Start Microsoft Visual Studio 2012 and open the Substitution Cipher Project Has everyone finished the program from last class

More information

A Summoner's Tale MonoGame Tutorial Series. Chapter 15. Saving Game State

A Summoner's Tale MonoGame Tutorial Series. Chapter 15. Saving Game State A Summoner's Tale MonoGame Tutorial Series Chapter 15 Saving Game State This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials will

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

FDSc in ICT. Building a Program in C#

FDSc in ICT. Building a Program in C# FDSc in ICT Building a Program in C# Objectives To build a complete application in C# from scratch Make a banking app Make use of: Methods/Functions Classes Inheritance Scenario We have a bank that has

More information

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2 Class Test 4 Marks will be deducted for each of the following: -5 for each class/program that does not contain your name and student number at the top. -2 If program is named anything other than Question1,

More information

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان در این مقاله با دو روش از روشهای خواندن اطالعات از فایل های اکسل و نوشتن آنها در DataGridView بدون استفاده از ( Automation Excelبا استفاده از NPOI و( ADO.Net آشنا میشوید. راه اول : با استفاده از (xls)

More information

II. Programming Technologies

II. Programming Technologies II. Programming Technologies II.1 The machine code program Code of algorithm steps + memory addresses: MOV AX,1234h ;0B8h 34h 12h - number (1234h) to AX register MUL WORD PTR [5678h] ;0F7h 26h 78h 56h

More information

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using 1 using System; 2 using System.Diagnostics; 3 using System.Collections.Generic; 4 using System.ComponentModel; 5 using System.Data; 6 using System.Drawing; 7 using System.Text; 8 using System.Windows.Forms;

More information

IST311 Chapter13.NET Files (Part2)

IST311 Chapter13.NET Files (Part2) IST311 Chapter13.NET Files (Part2) using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text;

More information

RegEx - Numbers matching. Below is a sample code to find the existence of integers within a string.

RegEx - Numbers matching. Below is a sample code to find the existence of integers within a string. RegEx - Numbers matching Below is a sample code to find the existence of integers within a string. Sample code pattern to check for number in a string: using System; using System.Collections.Generic; using

More information

LIGHT_P_TOGGLE, LIGHT_N_TOGGLE, BATTERY_TOGGLE, ALTERNATOR_TOGGLE, AVIONICS_TOGGLE, FLOAT_RETRACT, FLOAT_EXTEND }

LIGHT_P_TOGGLE, LIGHT_N_TOGGLE, BATTERY_TOGGLE, ALTERNATOR_TOGGLE, AVIONICS_TOGGLE, FLOAT_RETRACT, FLOAT_EXTEND } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO.Ports; using Microsoft.FlightSimulator.SimConnect;

More information

RegEx-validate IP address. Defined below is the pattern for checking an IP address with value: String Pattern Explanation

RegEx-validate IP address. Defined below is the pattern for checking an IP address with value: String Pattern Explanation RegEx-validate IP address Defined below is the pattern for checking an IP address with value: 240.30.20.60 String Pattern Explanation 240 ^[0-9]1,3 To define the starting part as number ranging from 1

More information

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); 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; using Edidev.FrameworkEDIx64;

More information

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); }

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); } เว บแอพล เคช น 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; namespace

More information

Chapter 12. Tool Strips, Status Strips, and Splitters

Chapter 12. Tool Strips, Status Strips, and Splitters Chapter 12 Tool Strips, Status Strips, and Splitters Tool Strips Usually called tool bars. The new ToolStrip class replaces the older ToolBar class of.net 1.1. Create easily customized, commonly employed

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

A Summoner's Tale MonoGame Tutorial Series. Chapter 10. Creating Avatars

A Summoner's Tale MonoGame Tutorial Series. Chapter 10. Creating Avatars A Summoner's Tale MonoGame Tutorial Series Chapter 10 Creating Avatars This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials will

More information

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Objectives : 1) To understand the how Windows Forms in the Windows-based applications. 2) To create a Window Application

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

More information

Creating a Role Playing Game with XNA Game Studio Part 50 Items - Part 4b

Creating a Role Playing Game with XNA Game Studio Part 50 Items - Part 4b Creating a Role Playing Game with XNA Game Studio Part 50 Items - Part 4b To follow along with this tutorial you will have to have read the previous tutorials to understand much of what it going on. You

More information

EE 356 Assigned: Oct. 4, 2017 Project 4 Due: Oct. 16, 2017

EE 356 Assigned: Oct. 4, 2017 Project 4 Due: Oct. 16, 2017 EE 356 Assigned: Oct. 4, 2017 Project 4 Due: Oct. 16, 2017 Travelling Salesman Problem using Genetic Programming The travelling salesman problem (TSP) can be stated as: A salesman is required to visit

More information

Programming. C++ Basics

Programming. C++ Basics Programming C++ Basics Introduction to C++ C is a programming language developed in the 1970s with the UNIX operating system C programs are efficient and portable across different hardware platforms C++

More information

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky Brian Kiser November 2010 Vigilant C# 2.5 Commonwealth of Kentucky Frankfort, Kentucky Table of Contents 1.0 Work Sample Description Page 3 2.0 Skills Demonstrated 2.1 Software development competency using

More information

Chromatic Remote Control Product Guide Executive Way, Suite A Frederick, MD 21704

Chromatic Remote Control Product Guide Executive Way, Suite A Frederick, MD 21704 Chromatic Remote Control Product Guide 7340 Executive Way, Suite A Frederick, MD 21704 Document Version: 2.1 December 2013 Contents 1 Introduction... 3 2 Accessing Chromatic Remote Control... 4 2.1 Configure

More information

Weather forecast ( part 1 )

Weather forecast ( part 1 ) Weather forecast ( part 1 ) I will create a small application that offers the weather forecast for a certain city in the USA. I will consume two webservices for this. The first service will give me an

More information

LISTING PROGRAM. void KOMPRESIToolStripMenuItemClick(object sender, EventArgs e) { Kompresi k = new Kompresi(); k.show(); this.

LISTING PROGRAM. void KOMPRESIToolStripMenuItemClick(object sender, EventArgs e) { Kompresi k = new Kompresi(); k.show(); this. A - 1 LISTING PROGRAM 1. Form Menu Utama using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; namespace KompresiCitra / / Description of MainForm.

More information

C# winforms gridview

C# winforms gridview C# winforms gridview 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

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems Excel and C# Overview Introduction to DatabaseSupport Systems Building a Web-Enabled Decision Support System Integrating DSS in Business Curriculum 2 Decision Support Systems (DSS) A decision support system

More information

Network Operation System. netstat. ipconfig/tracert/ping. nslookup EEE 448 Computer Networks

Network Operation System. netstat. ipconfig/tracert/ping. nslookup EEE 448 Computer Networks EEE 448 Computer Networks with (Network Programming) Lecture #4 Dept of Electrical and Electronics Engineering Çukurova University Network Operation System When you are on the internet or are working in

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

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

string spath; string sedifile = 277_005010X228.X12; string sseffile = 277_005010X228.SemRef.EVAL0.SEF; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI; 1 namespace

More information

RIS214. Class Test 3

RIS214. Class Test 3 RIS214 Class Test 3 Use console applications to solve the following problems and employ defensive programming to prevent run-time errors. Every question will be marked as follows: mark = copied? -5 : runs?

More information

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

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects 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

More information

A Summoner's Tale MonoGame Tutorial Series. Chapter 11. Battling Avatars

A Summoner's Tale MonoGame Tutorial Series. Chapter 11. Battling Avatars A Summoner's Tale MonoGame Tutorial Series Chapter 11 Battling Avatars This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials will

More information

Motivation. Reflection in C# Case study: Implicit Serialisation. Using implicit serialisation. Hans-Wolfgang Loidl

Motivation. Reflection in C# Case study: Implicit Serialisation. Using implicit serialisation. Hans-Wolfgang Loidl Reflection in C# Motivation Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh Sometimes you want to get access to concepts in C# that

More information

CSC 355 PROJECT 4 NETWORKED TIC TAC TOE WITH WPF INTERFACE

CSC 355 PROJECT 4 NETWORKED TIC TAC TOE WITH WPF INTERFACE CSC 355 PROJECT 4 NETWORKED TIC TAC TOE WITH WPF INTERFACE GODFREY MUGANDA In this project, you will write a networked application for playing Tic Tac Toe. The application will use the.net socket classes

More information

Computer measurement and control

Computer measurement and control Computer measurement and control Instructors: András Magyarkuti, Zoltán Kovács-Krausz BME TTK, Department of Physics 2017/2018 spring semester Copyright 2008-2018 András Magyarkuti, Attila Geresdi, András

More information

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi Turku University of Applied Sciences Degree Programme in Business Information Technology

More information

ComponentOne. Document Library for WinForms

ComponentOne. Document Library for WinForms ComponentOne Document Library for WinForms GrapeCity US GrapeCity 201 South Highland Avenue, Suite 301 Pittsburgh, PA 15206 Tel: 1.800.858.2739 412.681.4343 Fax: 412.681.4384 Website: https://www.grapecity.com/en/

More information

Class Test 5. Create a simple paint program that conforms to the following requirements.

Class Test 5. Create a simple paint program that conforms to the following requirements. Class Test 5 Question 1 Use visual studio 2012 ultimate to create a C# windows forms application. Create a simple paint program that conforms to the following requirements. The control box is disabled

More information

A Summoner's Tale MonoGame Tutorial Series. Chapter 8. Conversations

A Summoner's Tale MonoGame Tutorial Series. Chapter 8. Conversations A Summoner's Tale MonoGame Tutorial Series Chapter 8 Conversations This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials will make

More information

Listing Program. private void exittoolstripmenuitem_click(object sender, EventArgs e) { Application.Exit(); }

Listing Program. private void exittoolstripmenuitem_click(object sender, EventArgs e) { Application.Exit(); } Listing Program Kode Program Menu Home: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

More information

USER GUIDE Conversion and Validation of User Input

USER GUIDE Conversion and Validation of User Input 2010 USER GUIDE Conversion and Validation of User Input Conversion and Validation of User Input Code On Time applications offer powerful methods of converting and validating field values entered by users.

More information

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011 Hands-On Lab Lab: Client Object Model Lab version: 1.0.0 Last updated: 2/23/2011 CONTENTS OVERVIEW... 3 EXERCISE 1: RETRIEVING LISTS... 4 EXERCISE 2: PRINTING A LIST... 8 EXERCISE 3: USING ADO.NET DATA

More information