Solved

Insert the Missing Statement(s) in the Following Code Fragment

Question 13

Multiple Choice

Insert the missing statement(s) in the following code fragment. The code is intended to display a message "Your cost is: " in a text area and display the cost on the next line.
Double cost = 500.99;
String message = "Your cost is:";
JTextArea result = new JTextArea(10, 30) ;
__________________________________________
Result.setEditable(false) ;


A) result.setText(message) ;
Result.append(cost) ;
B) result.addText(message + "\n" + cost) ;
C) result.append(message + cost) ;
D) result.setText(message + "\n") ;
Result.append(cost) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions