Discover
Questions library
Collections library
Find online teacher
login
Discover
questions library
Find online teacher
login
Popular searches:
if-else
class-diagram
flowchart
Polymorphism
Home
Questions
Questions
Study lists
Ashoor Questions
555 Questions
(Add package statement) Suppose you have Java source files under the directories chapter1, chapter2, . . . , chapter34
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
176
(Game: hangman) Rewrite Programming Exercise 7.35. The program reads the words stored in a text file named hangman.txt. Words are delimited by spaces
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
160
(Replace text) Listing 12.16, ReplaceText.java, gives a program that replaces text in a source file and saves the change into a new file. Revise the program to save the change into the original file. For example, invoking
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
200
(Write/read data) Write a program to create a file named Exercise12_15.txt if it does not exist. Write 100 integers created randomly into the file using text I/O. Integers are separated by spaces in the file. Read the data back from the file and display the data in increasing order
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
299
(Process scores in a text file) Suppose that a text file contains an unspecified number of scores separated by blanks. Write a program that prompts the user to enter the file, reads the scores from the file, and displays their total and average
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
197
(Count characters, words, and lines in a file) Write a program that will count the number of characters, words, and lines in a file. Words are separated by whitespace characters. The file name should be passed as a command-line argument, as shown in Figure 12.13
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
305
(Reformat Java source code) Write a program that converts the Java source code from the next-line brace style to the end-of-line brace style. For example, the following Java source in (a) uses the next-line brace style. Your program converts it to the end-of-line brace style in (b)
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
325
(Remove text) Write a program that removes all the occurrences of a specified string from a text file. For example, invoking
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
213
(OutOfMemoryError) Write a program that causes the JVM to throw an OutOfMemoryError and catches and handles this error
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
211
(BinaryFormatException) Exercise 12.7 implements the bin2Dec method to throw a BinaryFormatException if the string is not a binary string. Define a custom exception called BinaryFormatException. Implement the bin2Dec method to throw a BinaryFormatException if the string is not a binary string
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
312
(HexFormatException) Exercise 12.6 implements the hex2Dec method to throw a NumberFormatException if the string is not a hex string. Define a custom exception called HexFormatException. Implement the hex2Dec method to throw a HexFormatException if the string is not a hex string
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
238
(NumberFormatException) Write the bin2Dec(String binaryString) method to convert a binary string into a decimal number. Implement the bin2Dec method to throw a NumberFormatException if the string is not a binary string
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
196
(NumberFormatException) Listing 6.8 implements the hex2Dec(String hexString) method, which converts a hex string into a decimal number. Implement the hex2Dec method to throw a NumberFormatException if the string is not a hex string
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
204
Total:
555
Previous
4
5
6
7
8
Next
Go