public class UpcReceiptCalc { public static void main(String args[]) { } public void calculateSalesReceipt() { // CALL readProductDB // CALL processUPCs // CALL assembleSalesReceipt // CALL showInvalidList } public void readProductDB() { //open "productDB.txt" file //FOR each line in input file LOOP // parse the input line //Add line to product db //END LOOP } public void processUPCs() { //WHILE more upc's exist LOOP //READ upc //IF product found in DB THEN // increase count and total //END IF //END LOOP } public void assembleSalesReceipt() { // FOR each item in purchase list LOOP // compute the subtotal as itemcount * price. // format a line with product name, itemcount, subtotal // append the line to the receipt // END LOOP // Append the total price as the last line of the receipt } public void showInvalidList() { //Display each item in invalidlist } public void lookupProduct() { //IF (verifiedUPC exists) THEN //IF productDB does not contain (upc) THEN // create an invalid item from upc and "not in DB" // add invalid item to the invalid list. // END IF // END IF } public void verifyUPC() { //Given a raw upc apply the Check Digit algorithm provided. //IF not verified THEN // create an invalid item from upc and "invalid check digit" // add invalid item to the invalid list. //ELSE // set verifiedUPC from upc //END IF } public boolean checkDigit(String upc) { //calc sum of odd-numbered positions & multiply by 3 //if lastDigit == 0 //return true; } public void countProduct() { //Given a product, increment the itemcount in purchase list. // If this is the first purchase of this product // create a new product count // ELSE // update the count for a previously purchased product } public void computeTotal() { //Given a product, increment the total price with the price of this product. }