Program to order a product from inventory, Visual Basic Programming

Assignment Help:

Write a program that permits the user to order a product from inventory. The user selects the product and enters the quantity. If there is sufficient quantity on hand of the product to fulfill the order:

1.  the price is retrieved from a product array,

2.  the cost (quantity * price) is calculated,

3.  the order information is displayed on the form,

4.  the quantity ordered is deducted from the inventory array,

5.  the order is written to an output file.

Otherwise, the user should be notified that there is an insufficient quantity on hand. The user must print preview the completed order (Product, Cost) before entering another order. And the user should not be able to print preview until an order has been processed. The user has the option to print preview a report (Product, Quantity on Hand, Price) of the current product inventory. The user ends the program by clicking exit. Download, unzip and run the executable Program 4 (Debug folder - right click and click "Open in New Window") to see what the interface could look like and what the functionality should be. There are two files included with the executable. Open (double click on the file name) the Products.txt before you run the program and the OrdersFile.txt files after you running the program and generating a few orders.

This program incorporates concepts and statements from all chapters but primarily from chapters 8 and 9.

Remove a product from BOTH the ProductRecord array and the product ListBox that is sold out (quantity = 0). Hint: Use concepts from the Bubble Sort (in Handouts) to remove a product from the inventory array.

Back your program up by making a copy of it on another device at the conclusion of each Visual Basic session.  Programs lost due to computer crashes or lost/broken jump drives that are submitted late will result in point deductions!  To back up the program, go to Windows Explorer and copy / paste the solution folder (the highest level folder where you see your program name) onto another device.  Do NOT do a FILE SAVE AS to save the program on another device as this will not copy all of the files that belong to the solution.

Requirements:

  • Name the folder/program using your initials and last name and program number, e.g., SmithCRProgram1 where a student's last name is Smith and initials are C.R.
  • Follow naming conventions for controls, constants and variables given in the book, i.e., use the appropriate prefixes to indicate type of control, data type of constants and variables, and scope of variables.
  • Follow documentation recommendations as demonstrated in the Test Scores program.
  • Begin all programs with your name, program number and program summary.
  • On the fourth Tab from the left edge, document the algorithm above the related line.
  • Include procedure headers as demonstrated in the Test Scores program.
  • Use asterisks for event procedure headers.
  • Use hyphens for any general procedure headers that you may include.
  • Follow code indentation conventions.
  • Incorporate design principles and user-friendly features into your interface.
  • Set the form's StartPosition property value to CenterScreen.
  • Set the form's Width property no larger than 400; the Height property no larger than 400 with your screen resolution set to 800 x 600 pixels.
  • Create and store in the bin/Debug folder of your project a sequential-access text file in Notepad containing the following data with one field per row:

Product                    Quantity          Price

A45                      2                 4.50

B24                      5                  2.40

C12                      3                  7.50

D78                      4                  8.20

E45                       6                  3.10

  • Define a ProductRecord structure that contains fields for Product, Quantity on Hand and Price. Declare and use an array of the ProductRecord structure to process orders. Read the data for the array in from the sequential-access text file in the form's Load event procedure.
  • Use a ListBox for the products. These products must be added from the array at the runtime. Do this in the form's Load event procedure.
  • Use a ComboBox to display the range of quantities. If you think that it would be fun, you may want to try to use NumericUpDown control (see Help) for entering the quantity instead of a ComboBox!
  • The product's price must be retrieved from the array.
  • In the Order button's Click event procedure, write the product number and cost to a sequential-access text file. You will have to close the file at the end of the procedure so that it can be reopened for the next order.
  • Use the button's .Enabled property to prevent the user from print previewing before ordering and not ordering again until the order has been print previewed.
  • Read Chapter 9 Discussion and the Chap9Movies program available for download in the discussion to learn how to print preview. You may use Chap9Movies as a model for printing the order and report in this program.
  • Include ToolTips for the Buttons.
  • Set Option Strict to On. Let Option Explicit stay set to On (default).
  • Declare and use variables declared at the appropriate scope and of the appropriate data type to store the results of the calculations prior to displaying them.
  • Use a Try Catch block to catch exceptions. Display appropriate error message(s).

Related Discussions:- Program to order a product from inventory

Deleting records - data control, Deleting Records: To remove a record ...

Deleting Records: To remove a record use the Delete method. To delete the record from the customer table follow the coding as shown below: data1.RecordSource = "Customer"

Help, Assume that s is a string variable that is supposed to contain a va...

Assume that s is a string variable that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable and displ

Retrieval methods - document in visual programming, Retrieval Methods: ...

Retrieval Methods: There are 3 ways to find a document. The primary method is a positional retrieval. This is achieved by keeping in mind where you left it. The next method is

Validation controls, Describe different validation controls of VB.net?

Describe different validation controls of VB.net?

Context-sensitive help, CONTEXT-SENSITIVE HELP   The Context-sensitive...

CONTEXT-SENSITIVE HELP   The Context-sensitive help gives online help for the circumstances which is associated with that state. The Context-sensitive help can be implemented

Infomation system, what are the things that information system can do and t...

what are the things that information system can do and their limitations?

Calculating annual percent yield, I am having a hard time with calculating ...

I am having a hard time with calculating APY in my project. Every time I run the program my second APY is blank.

Source property, Returns or sets the name of the object or application whic...

Returns or sets the name of the object or application which generated the error originally. The Source property indicates a string expression which is usually the class name or pro

Associating images to toolbars - visual basic, Associating Images to Toolba...

Associating Images to Toolbars: 1. Add an Image list to your form from the tool box. 2. Pick the custom property of the image list. 3. Click the images tab. 4. Select

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd