433-254 Project A FAQ and Errata ******************************** -- Extracted from discussion and Q&A on cs.254 newsgroup -- This will be periodically updated based on cs.254 newsgroup discussion -- Thanks to Selina Dennis for volunteering to compile it. ------------------------------------------------------------------------------------------------ 3/9/03 Q: Is the CommandID user input, or program generated? A: User input. Q: Do items in the user input have to be separated by commas? A: Yes. Q: What is the CommandID for? A: It is simply an integer number, incremented, and unique. Q: What happens if a user doesn't input an integer CommandID? A: Report it as an error. Q: Does it matter how I implement the "10 digit characters" requirement? Should they be numeric, or alpha-numeric? A: This should be a choice you make as part of your design. Q: Why is price common information? Aren't pamphlets worth $0? A: Yes, pamphlets are 0.00. Q: What does and similar references mean? A: These are requirement numbers. You should use these when referring to errors (as per p.5 of spec) Q: The spec lists two references, one for PRODUCT_INQUIRY, one for SALES_INQUIRY. Is this right? A: No, it is not. Replace SALES_INQUIRY reference with Q: In the spec, it lists under the pamphlet information: "A unique CD ID". Is this a typo? A: Yes, change it to 'Pamphlet ID'. 4/9/03 Q: Can we assume that we will never get the same ID again? A: Yes. Q: Is the program waiting for the user to use one of the six commands? A: Yes. Make sure your program follows the spec, specifically pages 3, 4 and 5. Q: Is the program waiting for the next input (stdin)? A: Yes. Q: I would like to stop adding things, how do I terminate the program? A: Remember to follow the format for adding things. You terminate the the program by typing 'END' (page 3 of spec, on the bottom). Q: Is it possible to have more than one similar item? If two books have similar titles, etc, can we assume there is only one unique product ID for each item? A: Yes. There is only one ID for each item. Q: Can we assume we can use Java 1.4.2? A: Yes. Q: Do we have to check when doing ADD_SALES that the ID exists in our system? A: Add it to sales. This should be a decision you make as part of your design. Q: How is the END command called? Is it: [CommandID]:END: like all the other commands? A: Yes. 8/9/03 Q: In the examples, it has Computer_Science for books, and Romantic for CDs. Are these categories hardcoded, or can it be any string? A: Any string. Q: Do we need to submit a makefile with this project? A: No. Q: Should I include a user interface to my program? Such as a menu displaying the commands available? A: No. This is not an interactive program. Q: Does the total amount of sales for a product need to match the total amount of sales for each quarter? For example, does Q1+Q2+Q3+Q4 need to equal "total sales"? A: No, the spec says the quarterly sales are merely for "the current year". Assume the total amount of sales is the total amount over the lifecycle of the product, and may span multiple years. 10/9/03 ******* Q: Should products/sales report shows the exactly order that products are added? A: --------------------------------------------------------------------------------------- Since most students are in advanced stage of implementation, we don't want to change spec. However, I am OK with printing the output in one of the two methods/ways described below (although spec conveys you to follow OutputMethod 2): If the input Contains: If I entered two books (Book1 and Book2), 2 CDs (CD1 and CD2), 2 Phamplets (PHM1), and finally 1 book (Book3). OutputMethod 1: Printing them in the order of entry. The output will be ordered as follows: Book1 record Book2 record CD1 record CD2 record PHM1 record Book3 record OutputMethod 2: Printing them each product type (book, CD, then Phamplets), but in the order of entry for each product type. The output will be ordered as follows: Book1 record Book2 record Book3 record CD1 record CD2 record PHM1 record ------------------------------------------------------------------------- Q: Can I have 3rd option for output generation: to sort by product ID for each product type ? A: Yes, this is acceptable as a 3rd option. But this is optional (NOT a mandatory requirement). For example: If I entered two books (Book1 and Book2) with product ID 1212121211 and 1212121213; and 1 CDs (CD1 with product ID 2312121212), Phamplets (PHM1 with product ID 3235457212), and finally 1 book (Book3 with product ID 1212121212). OutputMethod 3: Printing them by each product type (book, CD, then Phamplets), but sorted (increasing order) by product Id will generate the output in following form: Book record (book1) with product ID 1212121211 Book record (book3) with product ID 1212121212 Book record (book2) with product ID 1212121213 CD record (CD1) with product ID 2312121212 Phamplet record (PHM1) with product ID 3235457212) Q: For the generate report command, is it supposed to do what is stated in or what is shown in . A: Please follow what is shown in shown in . is has been simplified since details are given in . It now reads as: A GENERATE_REPORT operation shall report the press products and sales details. Q: If we have an ADD_PRODUCT with an ID not equal to 10 chars and not beginning with 1, 2 or 3, how do we report that error? A: If the first digit is not 1-3, report the error as shown in the spec. The choice of error message is part of your design. Q: When would we report a FAILED BAD_COMMAND or FAILED OTHER error? A: Check the errors as specified in the specs. Don't worry about errors that aren't explicitly specified in the spec. We'll be concentrating more on error checking in our next assignment. Q: If we are trying to add a product that doesn't exist in the product list, do we add it to sales, or throw an error? A: You will not be encountering such situation in the input data that we will be using to test your program. Therefore, simply add to sales. If you have already implemented your program to test such situation and displaying an error, that is OK as this will not affect our I/O spec. of the project. As I said earlier, there are lot of error checking we can do, but for Proj A please focus on the use of OOD and OOP. Currently, pls check for errors that are given in the spec and rest assume that all data supplied is correct ones. In next Project (Proj B) we will focus a lot on errors etc. Q: If we have an ADD_PRODUCT with an ID not equal to 10 chars and not beginning with 1, 2 or 3, how do we report that error? A: If the first digit is not 1-3, report the error as shown in the spec. The choice of error message is part of your design. Q: When would we report a FAILED BAD_COMMAND or FAILED OTHER error? A: Check the errors as specified in the specs. Don't worry about errors that aren't explicitly specified in the spec. We'll be concentrating more on error checking in our next assignment. 15/9: Q: PRODUCT or PRODUCTS? Will you be using the provided output on automated testing? THe output differs from the spec on line 24, PRODUCT_REPORT. SHould we make it PRODUCTS_REPORT? A:The Project Spec says we use PRODUCTS_REPORT. It is better to use that. But since in our recent tastcase says PRODUCT_REPORT, whcih has been changed to PRODUCTS_REPORT (as per Spec). Although we will be accept both, I will recommend you to use PRODUCTS_REPORT. ------------------------------------------------------------------------------------------------ Note: Please check for whatever error is explicitly inidcated in the Project Spec. and handle that. The rest don't worry. Remeber "Programming is Art!" and each person has his own style and it is hard for me to prescribe for everyone when we are doing batch processing/testing. Therefore, please check only for errors that are indicated in the spec.