(Pick four cards) Write a program that lets the user click the Refresh button to display
four cards from a deck of 52 cards, as shown in Figure 16.21a. (Hint: See
Listing 6.2 on how to draw four cards randomly.)
I have a problem.The "refresh" button does nothing.Any ideea?
/*(Remove text) Write a program that removes all the occurrences of a specified
string from a text file. For example, invoking
java Exercise14_11 John filename
removes the string John from the specified file. Your program should get the
arguments from the command line.*/
I have a problem.
Text document is Match.txt
Match.txt contains a string: "Open the door John"
I tried to create a new file named doc.txt where to put the text from the Match.txt without John word
I'm trying to do this exercise:
(Game: ATM machine) Use the Account class created in Programming Exercise
8.7 to simulate an ATM machine. Create ten accounts in an array with id 0, 1, . . . ,
9, and initial balance $100. The system prompts the user to enter an id. If the id is
entered incorrectly, ask the user to enter a correct id. Once an id is accepted, the
main menu is displayed as shown in the sample run. You can enter a choice 1 for
viewing the current balance, 2 for withdrawing money, 3 for depositing money,
and 4 for exiting the main menu. Once you exit, the system will prompt for an id
again. Thus, once the system starts, it will not stop.
Enter an id:
1: check balance
Enter a choice:
(Check substrings) You can check whether a string is a substring of another string by using the indexOf method in the String class. Write your own method for
this function. Write a program that prompts the user to enter two strings, and checks whether the first string is a substring of the second.
I am looking for ideas to accomplish this program. I have no idea what the function should return