According to the text, for the ADT dictionary, a sorted array-based implementation will shift data during what two operations?
a. additions and removals
b. additions and traversals
c. removals and traversals
d. searches and gets
a. additions and removals
You might also like to view...
What actions can be specified for a Windows firewall rule?
What will be an ideal response?
Enhance the Interest Calculator application you built in this tutorial with error checking. Test whether the user has entered valid values for the principal and interest rate. If the user enters an invalid value, dis- play a message in a message dialog. Figure 10.30 demonstrates the application handling invalid input.
a) Copying the template to your working directory. Copy the C:Exam- plesTutorial10ExercisesInterestCalculatorEnhanced directory to your C:SimplyJava directory.
b) Opening the template file. Open the InterestCalculator.java file in your text editor.
c) Customizing the calculateJButtonActionPerformed method to handle invalid input. In line 143, enter a condition into the if statement that returns true when the principal or rate are negative, or when the rate is over 10.
d) Displaying the error message. In lines 145–147, display the message dialog shown in
Fig. 10.30. Use three lines for clarity.
e) Saving the application. Save your modified source code file.
f) Opening the Command Prompt window and changing directories. Open the Com- mand Prompt window by selecting Start > Programs > Accessories > Command Prompt. Change to your working directory by typing cd C:SimplyJavaInterest- CalculatorEnhanced.
g) Compiling the application. Compile your