Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Visual Basic Expert

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).

Visual Basic, Programming

  • Category:- Visual Basic
  • Reference No.:- M9523319

Have any Question?


Related Questions in Visual Basic

Pitch amp game design documentthe assignment is about

Pitch & Game Design Document The assignment is about educational driver for teenagers Assignment Brief: In groups you will: - present a pitch and produce a one sheet - provide a demonstration of your game - produce a hig ...

Please show how to do the belowvisual basic net application

Please show how to do the below: Visual Basic .NET Application - Coding Exercise 1 (Exercise 13, Zak, 2016, p. 347) For this coding exercise, write the Visual Basic code for a pretest loop that uses an Integer variable n ...

Assignment frans virtual fruit standfrans virtual fruit

Assignment: Fran's Virtual Fruit Stand Fran's Virtual Fruit Stand is an online store that sells several types of dried fruit. Based on the needs of Fran's Virtual Fruit stand, you must design a flowchart using Visual Log ...

Assignment virtual storeuse the concepts and scenario from

Assignment: Virtual Store Use the concepts and scenario from Assignment 1 to help "Your" Virtual Business to increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must stor ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As