I am having trouble with this question as it seems a bit vague to me. The concept appears more challenging than what we learned in class, and I'm not sure where to start. If someone could provide a simplified explanation, I would greatly appreciate it!
Question: Develop a program that reads an inventory file containing records with fields such as record code, part number, part description, and inventory balance. The task is to validate the record code and part number of each entry and print details for valid records whose part numbers range from AA3000 to AA3999 inclusive. Additionally, display a count of these selected records at the end of the parts listing.
I hope you can understand the requirements because I find them confusing. Any guidance or a step-by-step walkthrough would be immensely helpful. Below is the initial code provided to me:
var Rec_Code = new Array(11,11,11,12,11,12,11,13,11,14);
var Numer = new Array(2000,3000,3003,3008,3999,2000,1090,3678,3777,3543);
var Alpha = new Array("AA","AA","AX","AA","AA","AA","AB","AA","AN","AA");
var Desc = new Array("X","L","S","F","R","U","T","N","Q","Y");
var Inv_Bal = new Array(12,13,14,23,34,56,32,45,67,77);
In addition to this, specific instructions were given on how to proceed with the task, however, I am unsure of how to fully accomplish it.
- Use the variables provided to create five parallel arrays: RecCode, AlphaPart (part of part number), Numeric part of the part number, Description, and Inventory. Search through the first three arrays for:
- A RecCode of 11
- An AlphaCode of 'AA'
- A Numeric Code between 3000 - 3999 inclusive
Whenever there is a match, increment a counter and display the corresponding Description and Inventory details.