Question: public static wid madisting [ ] args ) throws IOExceptfon { boolean found = false; int cntFound = 0 ; int numSKUs = 0 ;

public static wid madisting[] args) throws IOExceptfon {
boolean found = false;
int cntFound =0;
int numSKUs =0;
String partSkU, partName, manufacturer, country;
String outstring;
Scanner scnr = new Scanner(System. In);
Get the PartSKU to Search from the User
System,out.println(PROMPT);
String search = scnr.nextline().strip().toUpperCase();
System.out.printlin
To do: insert your command for loading the INVENTORY _FILE here and a scanner object to hold it called "inFilin file" that we'll use to hold data.(}
f** TO DO: Loop through the Scanner inFile using a while loop to load
each successive line into the appropriate variables that we pre-defined:
partSKU, partName, manufacturer, country.
If the SKU was found at least once, print "SKU FOUND: "+ partSKU on the first item found and then print to the console the found information for each item found in the array as
partName -- manufacturer (country)
Use counters to track how nany objects you've found and how many you've searched in the file.
See the variables that we've provided and see if those can help you do that.
f : TO DO: If more than one match were found, print the WARNING message to the console
f : TO DO: Display standard completion messages for the different cases:
If no matches were found:
"No SKUs were found for: "+ search
If at least 1 record was found
(where # is the variable you're using for the # of records found):
"#+ record (s) found."
Also, print to the console how many records you searched
(where # is the variable you're using for the total records)
"# + "record(s) searched,"
public static wid madisting [ ] args ) throws

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!