C# Vending Machine Coding

This is a discussion on C# Vending Machine Coding within the C# Programming forums, part of the General Programming Boards category; Can someone help me out with this? imgur: the simple image sharer I kinda sucks in coding so please do ...

  1. #1
    Registered User
    Join Date
    Jul 2014
    Posts
    2

    C# Vending Machine Coding

    Can someone help me out with this? imgur: the simple image sharer

    I kinda sucks in coding so please do help me out.

    Thank you in advance.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    2,588
    what part is giving you trouble? what have you tried so far?
    Code:
    namespace life
    {
        const bool change = true;
    }

  3. #3
    Registered User
    Join Date
    Jul 2014
    Posts
    2
    the part where you press "A2" e.g. then the message box shows up the price. And then the change come up

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    That interface looks like old school Windows Forms. Intercept the button press, show a message box with the price and do math to get the change. In C# this amounts to a button press event handler, a call to System.Windows.Forms.MessageBox.Show() and some math.

    If it is WPF and you are using MVVM then ensure your view model is the DataContext of the control. Create a DelegateCommand class and bind the Command of the button to the DelegateCommand in your view model. Use System.Windows.MessageBox for message boxes in WPF and the rest is the same math as in the Forms application. If you are not using MVVM then bind to the button press event of the button and put the rest of the button handler logic in the code behind.

    If it is Silverlight then stop right now and move on because it has effectively been deprecated.
    Last edited by VirtualAce; 08-07-2014 at 02:32 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-22-2010, 05:54 PM
  2. Replies: 7
    Last Post: 11-22-2009, 04:11 AM
  3. Vending Machine Logic?
    By shwetha_siddu in forum C Programming
    Replies: 10
    Last Post: 04-07-2009, 04:33 AM
  4. Wanna test vending machine
    By Roaring_Tiger in forum Tech Board
    Replies: 6
    Last Post: 08-25-2004, 06:51 PM
  5. Vending machine
    By Unregistered in forum C++ Programming
    Replies: 6
    Last Post: 06-13-2002, 11:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21