question archive When the user selects choice 3 from the Data Analysis menu, call the toString method for the object at that position in the array to display to the user

When the user selects choice 3 from the Data Analysis menu, call the toString method for the object at that position in the array to display to the user

Subject:AccountingPrice: Bought3

When the user selects choice 3 from the Data Analysis menu, call the toString method for the object at that position in the array to display to the user. You must have error checking here. making sure that the user can only display customers that exist in the array. The only input you do not have to error check is user input that is double type. For example, if the user types in 34.56, it is OK to treat that input as 34 (because TextIO.getInInt will chop off the decimal part - that is OK with me)- For example, suppose your input file has 100 rows and your code is set up to have an array of size 150. Suppose of the 100 rows in the input file, only 75 of them have valid data. So you create 75 objects, numbered from 0 to 74 in the array. Examples given the situation above: The user asks to view the object at spot 4. Your code should call the toString method for the object at spot 4 and display this to the user. The user asks to view the object at spot "Lehigh". Your code should show an error message to the user and ask for corrected input. The user asks to view the object at spot -87. Your code should show an error message to the user and ask for corrected input. The user asks to view the object at spot 87. Your code should show an error message to the user and ask for corrected input (because there is no spot 87 - there is valid data in the array only up to spot 74).

 

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE