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

Control statements, CONTROL STATEMENTS   The conditional expression us...

CONTROL STATEMENTS   The conditional expression uses a comparison operator that results in true or false value. If the comparison is valid the outcome is true, or else the out

Programming, i have connected my visual basic 2010 express in ports and use...

i have connected my visual basic 2010 express in ports and use it to send sms but it failed... now my teacher said that i have to use my LAN not port to send it instead..... please

Indexing - visual basic, Indexing: In libraries, the card catalog is t...

Indexing: In libraries, the card catalog is the index. The three indices are used in the library. The Author, Subject and title are the 3 indices. Each index is relative. The

Vbscript operators, VBScript Operators VBScript contain a full range of...

VBScript Operators VBScript contain a full range of operators, including comparison operators, arithmetic operators, concatenation operators, and logical operators.

Events, everything about events

everything about events

Crop image from tif and paste it on Excel Sheet, I have a tiff image of 25 ...

I have a tiff image of 25 pages. I capture particular square from particular page and past on one excel sheet one by one. it is possible, if yes how. Image have line no and pe

Dynamic link library - database applications, DYNAMIC LINK LIBRARY   T...

DYNAMIC LINK LIBRARY   The dynamic link library (dll) permits one copy of a function to be shared among some parallel executing programs. The dll is a file that contains a num

Properties of object method, Properties: VBScript Err Object ...

Properties: VBScript Err Object   Properties   Description   D escription Property The descriptive string related

Coding, Write an event procedure to automate the billing system of a superm...

Write an event procedure to automate the billing system of a supermarket. Give the details of database tables, forms, controls and menu design (if any). Make assumptions, wherever

Object naming conventions, The following table lists suggested conventions ...

The following table lists suggested conventions for objects you might encounter while programming VBScript. Code Commenting Conventions All process should begin with a brie

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