Question: Programming language is C# in Visual Studio. Part 1 (5 points) For lab 7 you will be creating an application to store 2 products into
Programming language is C# in Visual Studio.
Part 1 (5 points) For lab 7 you will be creating an application to store 2 products into a rectangular array. Use a message box to print the contents of the array. Name the form products. Product Code Product Name Price Quantity on Hand DS35Oak Oak Dining Room Set $3,299.89 4 DS12Maple Maple Dining Room Set $1,899.99 5

Part 2 (5 points) For part 2 expand on what you did for part 1. You will add the option to allow the user to change the quantity on hand. Use a list box or combo box to display the product code. The button adjusts Quantity on hand in the array you made in part 1. Adjust Quantity should execute a method to manage the arrays quantity value. The button show array contents should run a method to display the dialog box from part 1.
'
I have tried several solutions that are already posted here and none of them seem to be working for me. I posted both parts as they are linked together in the assignment. Part 1 should display the array as shown in the screenshot. Part 2 should allow the user to adjust the quantity.
Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;
namespace Lab7_Part1_Products_CRupe { public partial class FrmProducts : Form { public FrmProducts() { InitializeComponent(); } //Form load event private void FrmProducts_Load(object sender, EventArgs e) { //declaring rectangular/two dimensional array string[,] productsArray = new string[,] { {"DS35Oak","Oak Dining Room Set","$3299.89","4"}, { "DS12Maple","Maple Dining Room Set","$1899.99","5"} }; //declaring variable string prod = "Product Code \t Product Name \t\t Price\tQuantityHand" + Environment.NewLine; //using for loop to display array elements on the message box for (int i = 0; i Price Quantity on Hand Product Code DS350ak DS12Maple Product Name Oak Dining Room Set Maple Dining Room Set $3,299.89 4 $1,899.99 5 Part 2 (5 points) Products x Select Product Code: 5350ak Change Quantity to: 3 Adjust Quantity Show Array Contents Exat
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
