Placeholder

CIS355A Final Exam Multiple Choice Questions

$19.00

Description

Question 1. (TCOs 1–6) The data displayed in a JTable can be provided by a _____ object. (Points : 4)
TableModel
GridModel
DefaultTableModel
TableGridModel
Question 2. (TCOs 1–6) What is the output of the code below?
double num = 56.4321; System.out.printf(“%.3f”, 56.4321); (Points : 4)
%.3f
%.3f56.4321
56.432
56.4321
Question 3. (TCOs 1–6) Arguments to methods always appear within (Points : 4)
brackets.
parentheses.
quotation marks.
curly braces.
Question 4 (TCOs 1–6) What would be the result of attempting to compile and run the following code?
public class Test { public static void main(String[ ] args) { double[ ] x = new double[ ]{1, 2, 3}; System.out.println(“Value is ” + x[1]); } }
(Points : 4)
The program has a compile error because the syntax new double[ ]{1, 2, 3} is wrong, and it should be replaced by new double[ ]{1.0, 2.0, 3.0};
The program compiles and runs fine and the output “Value is 2.0” is printed.
The program has a compile error because the syntax new double[ ]{1, 2, 3} is wrong, and it should be replaced by new double[3]{1, 2, 3};
The program compiles and runs fine and the output “Value is 1.0” is printed.
Question 5. (TCOs 1, 2, and 6) You must call most methods other than _____ explicitly to tell them to perform their tasks. (Points : 4)
public methods
main
private methods
static methods
Question 6. (TCOs 1–6) Invoking _____ removes all elements in an ArrayList x. (Points : 4)
x.delete()
x.clear()
x.empty()
x.remove()
Question 7. (TCO 1, 4, and 6) The maximum number of radio buttons that can be selected within a ButtonGroup is (Points : 4)
1
2
5
all
Question 8. (TCOs 1–6) Which statements are most accurate regarding the following classes?
class A { private int i; protected int j; } class B extends A { private int k; protected int m; }
(Points : 4)
An object of B contains data fields j, m.
An object of B contains data fields j, k, m.
An object of B contains data fields k, m.
An object of B contains data fields i, j, k, m.
Question 9. (TCOs 1–6) Suppose ArrayList x contains two strings [Beijing, Singapore]. Which of the following methods will cause the list to become [Beijing, Chicago, Singapore]? (Points : 4)
x.add(“Chicago”)
x.add(2, “Chicago”)
x.add(0, “Chicago”)
x.add(1, “Chicago”)
Question 10. (TCOs 1, 5, and 6) Which statement sets up a tokens object that will use the % as a field delimiter? (Points : 4)
tokens = StringTokenizer(inputString, “%”);
tokens = new StringTokenizer(inputString, “%”);
tokens = StringTokenizer(“%”, inputString);
tokens = new StringTokenizer(“%”, inputString);
Question 11. (TCOs 1–6) Which of the following statements causes the program to terminate when closing the frame? (Points : 4)
frame.setDefaultCloseOperation(null)
frame.setDefaultCloseOperation(JFrame.STOP_ON_CLOSE)
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
frame.setDefaultCloseOperation(JFrame.TERMINATE_ON_CLOSE)
Question 12. (TCOs 1, 5, and 6) Which type of exception occurs if the write method of BufferedWriter cannot write data to the file? (Points : 4)
WriteException
IOException
FileIOException
FileException
Question 13. (TCOs 1–6) Suppose a JFrame uses the GridLayout(0, 2). If you add six buttons to the frame, how many rows are displayed? (Points : 4)
2
3
1
4
Question 14. (TCOs 1–6) The interface _____ should be implemented to listen for a button action event. (Points : 4)
FocusListener
ContainerListener
ActionListener
WindowListener
Question 15. (TCOs 1–6) The datatype returned by the JOptionPane.showInputDialog method is (Points : 4)
String
int
double
specified by the user in the method call
Question 16. (TCOs 1, 4, and 6) Menus are attached to windows by calling the _____ method. (Points : 4)
addMenuBar
setJMenuBar
setMenu
addJMenuBar
Question 17. (TCOs 1–6) When implementing a method, use the class’s set and get methods to access the class’s _____ data. (Points : 4)
public
private
protected
All of them
Question 18. (TCOs 1, 4, and 6) Which component allows users to access a layer of GUI components via a tab? (Points : 4)
JTabs
JTabPane
JTabbedPane
JTabPanel
Question 19. (TCOs 1–6) A constructor cannot (Points : 4)
be overloaded.
initialize variables to their defaults.
specify return types or return values.
have the same name as the class.
Question 20. (TCOs 1–6) A method that is associated with an individual object is called (Points : 4)
an object method.
an instance method.
a class method.
a static method.
Question 1. (TCOs 1, 5, and 6) What must you make available to your application before you can use JDBC to connect to a database? (Points : 4)
A database driver
A web server
A firewall
An ODBC data source
Question 2. (TCOs 1–6) _____ represents an entity in the real world that can be distinctly identified. (Points : 4)
A class
An object
A data field
A method
Question 3. (TCOs 1–6) To execute the query “select * from Address” using the Statement object named stmt that has been properly configured with a database connection, use (Points : 4)
stmt.executeUpdate(“select * from Address”);
stmt.execute(“select * from Address”);
stmt.executeQuery(“select * from Address”);
tmt.query(“select * from Address”);
Question 4. (TCOs 1–6) Suppose that your program accesses a MySQL database. Which of the following statements is false? (Points : 4)
If the database is not available, the program will have a runtime error when attempting to create a connection object.
If the driver for MySQL database is not in the classpath, the program will have a runtime error, indicating that the driver class cannot be loaded.
If the driver for MySQL database is not in the classpath, the program will have a syntax error.
If the database connection cannot be made, a SQLException occurs.
Question 5. (TCOs 1–6) Invoking Class.forName method when the database driver has not been configured into the project may throw (Points : 4)
ClassNotFoundException.
IOException.
SQLException.
RuntimeException.
Question 6. (TCOs 1–6) Which of the following statements is used to create an object to write to a file named out.dat? (Points : 4)
BufferedWriter outfile = new BufferedWriter(FileWriter(“out.dat”));
BufferedWriter outfile = new BufferedWriter (new File(“out.dat”));
BufferedWriter outfile = new BufferedWriter (new FileWriter(“out.dat”));
BufferedWriter outfile = new BufferedWriter (“out.dat”);
Question 7. (TCOs 1–6) Which type of exception occurs when creating a BufferedReader object for a nonexistent file? (Points : 4)
FileNotExist
FileNotFound
FileNotExistException
FileNotFoundException
Question 8. (TCOs 1–6) Which class can be used to read data into a text file? (Points : 4)
BufferedReader
System
ReadFile
FileRead
Question 9. (TCOs 1–6) Result set meta data are retrieved through (Points : 4)
a Statement object.
a Connection object.
a ResultSet object.
a PreparedStatement object.
Question 10. (TCOs 1–6) _____ checks whether the JCheckBox jchk is selected. (Points : 4)
jchk.isSelected().
jchk.selected()
jchk.select()
jchk.getSelected()
Question 11. (TCOs 1–6) The method _____ gets the contents of the text field txtName. (Points : 4)
txtName.findString()
txtName.getText(s)
txtName.getString()
txtName.getText()
Question 12. (TCOs 1–6) The method _____ appends a string s into the text area jta. (Points : 4)
jta.appendText(s)
jta.append(s)
jta.setText(s)
jta.insertText(s)
Question 13. (TCOs 1–6) Which of the following statements is false? (Points : 4)
You can create a text field with a specified text.
You can disable editing on a text field.
You can specify the number of rows in a text field
You can specify the number of columns in a text field.
Question 14. (TCOs 1–6) A JList object can be populated with data stored in a(n) _____ object. (Points : 4)
ModelList
DefaultListModel
ListArray
DefaultModelList
Question 15. (TCOs 1–6) The _____ method of a radio button returns true if that button is “on”. (Points : 4)
isSelected()
getSelected()
Selected()
RadioSelected()
SCREENSHOTS
SOLUTION
PAYMENT
The solution includes a single word file.
Attachments [Move over files to preview content of those files]
CIS355A_Final_Exam.zip (41.66 KB)
cis355a final exam.docx
Price: $19
Buy Now
Checkout
Added to cart
Add to Cart
Checkout
Added to cart
You May Also Like:
CIS355A Final Exam Essay Questions
CIS355A Week 1 Lab Developing an OOP Console Application
CIS355A Week 2 Lab Developing a GUI Application
CIS355A Week 3 Lab BurgersRUs Point of Sale system
CIS355A Week 4 Course Project Flooring Application Analysis and Design
CIS355A Week 4 Lab Stocks4U Portfolio Management System
CIS355A Week 5 Lab File Processing Stocks4U Portfolio Management System
CIS355A Week 6 Lab Student Management System
CIS355A Week 7 Course Project Flooring Application User Manual and Application Code

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.