none
help a C# GUI program RRS feed

  • 问题

  • Objective

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

    Task

    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

    Computer

    $6,199.00

    20

    Phone

    $4,688.00

    30

    2011年11月28日 9:36

答案

  • 你好,

    MSDN有英文支持的论坛:

    http://social.msdn.microsoft.com/Forums/en-US/categories

    鉴于你的问题是WinForm项目开发相关的,建议你发帖至:

    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