help a C# GUI program RRS feed

  • 问题

  • Objective

    This assignment allows you to practice using classes, objects, and lists.


    In this assignment, your task is to develop a GUI-based application for a user, such as a shop keeper, to maintain current information of products in the shop, and to calculate the total price of the products purchased by a customer.  Each product consists of three elements: (1) product name, (2) price per piece, and (3) stock.  For simplicity, you may use a floating-point number to represent the price.  You have to design the interface of the application.

    Your application has to provide the following features:

    1.       Query the price and the number of stock of a product, which is selected by a combo box.


    2.       Calculate the total price of the products that are purchased by a customer.  The customer can purchase more than one piece of the same product.  Hence, your application has to allow the user to enter the quantity of each purchased product (but not selecting the same product more than one time). You can assume that there are no more than five different products will be purchased at one time.  (Hence, you can have five combo boxes for selecting products and five textboxes for entering the quantity of each selected product.)  In addition, your application has to check whether there are enough stock for the product.  If there is not enough stock, your application has to warn the user rather than calculating the total price.  After the total price is calculated and displayed, your application has to update the number of stock for each purchased product.


    3.       Add, modify (the elements of), or remove a product.

    Your application should have at least two forms.  One form is responsible for features 1 and 2, and another form is responsible for feature 3.

    You cannot assume that the user input is always valid.  Your application should warn the user for any invalid input.  Some examples of invalid inputs are: entering letters instead of a number for the price/stock, and entering a negative number for the price/stock.

    Besides the forms, you have to define at least one class, in which all the instance variables have to be declared as private.


    Every time the application runs, there are only two products, which are shown as follows:

    Product Name

    Price per Piece

    Initial Stock







    2011年11月28日 9:36


  • 你好,



    Windows Forms General Forum



    Hi jaychew,


    You can visit MSDN forum(English language supported). Your problem is related to WinForm development, you can post in Windows Forms General Forum to get better support.


    Thanks for your posting and understanding.

    Have a nice day.

    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    • 已标记为答案 Paul Zhou 2011年12月8日 6:54
    2011年11月29日 5:14