Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This project aims to generate several randomly ordered booklet and their answer sheet from a single input exam sample file. The program receives an input

This project aims to generate several randomly ordered booklet and their answer sheet from a single input exam sample file. The program receives an input text file with a restricted format(Check the sample input file, sample.txt) containing tens of multiple-choice questions(assume N questions) and the correct answer to each question. then the user determines how many booklets (assume m) with how many questions(assume n<=N) should be generated. As the output file, the program generates 2 files for each booklet, one for the questions and one for the answer sheet. in the booklets, the order of the questions should be random, and the options should be randomly changed.
Q1: Each class you create becomes a new ________ that can be used to declare variables and create objects.
a. package
b. instance
c. library
d. type.
ANS: d.
Q2: You can declare new classes as needed; this is one reason Java is known as a(n)________ language.
a. portable
b. incremental
c. extensible
d. virtual
ANS: c.
Q3: Which of the following statements is false?
a. Each class declaration that begins with the access modifier private must be stored in a file that has the same name as the class and ends with the .java filename extension.
b. Every class declaration contains keyword class followed immediately by the classs name.
c. Class, method and variable names are identifiers.
d. An object has attributes that are implemented as instance variables and carried with it throughout its lifetime.
ANS: a.
Q4: Which of the following statements is false?
a. By convention class names begin with an uppercase letter, and method and variable names begin with a lowercase letter.
b. Instance variables exist before methods are called on an object, while the methods are executing and after the methods complete execution.
c. A class normally contains one or more methods that manipulate the instance variables that belong to particular objects of the class.
d. Instance variables can be declared anywhere inside a class.
ANS: d.
Q5: Which of the following statements is true?
a. Each object (instance) of the class shares the classs instance variables.
b. Most instance-variable declarations are preceded with the keyword public, which is an access modifier.
c. Variables or methods declared with access modifier private are accessible only to methods of the class in which theyre declared.
d. None of the above is true.
ANS: c.
Q6: When a method terminates, the values of its local variables are ________.
a. saved
b. copied
c. restored
d. lost
ANS: d.
Q7: Which of the following statements is false?
a. Variables declared in the body of a particular method are local variables and can be used only in that method.
b. A methods parameters are local variables of the method.
c. Every methods body is delimited by left and right braces ({ and }).
d. Keyword null indicates that a method will perform a task but will not return any information.
ANS: d.
Q8: Which of the following statements is false?
a. The methods return type specifies the type of data returned to a methods caller.
b. Empty parentheses following a method name indicate that the method does not require any parameters to perform its task.
c. When a method that specifies a return type other than void is called and completes its task, the method must return a result to its calling method
d. Classes often provide public methods to allow the classs clients to set or get private instance variables; the names of these methods must begin with set or get.
ANS: d.
Q9: A class that creates an object of another class, then calls the objects methods, is called a(n)________ class.
a. object-oriented
b. inherited
c. caller
d. driver.
ANS: d.
Q10: Which of the following statements is false?
a. Scanner method next reads characters until any white-space character is encountered, then returns the characters as a String.
b. To call a method of an object, follow the object name with a comma, the method name and a set of parentheses containing the methods arguments.
c. A class instance creation expression begins with keyword new and creates a new object.
d. A constructor is similar to a method but is called implicitly by the new operator to initialize an objects instance variables at the time the object is created.
ANS: b.
Q11: Which of the following statements is true?
a. Local variables are automatically initialized.
b. Every instance variable has a default initial valuea value provided by Java when you do not specify the instance variables initial value.
c. The default value for an instance variable of type String is void.
d. The argument types in the method call must be identical to the types of the corresponding parameters in the methods declaration.
e. ANS: b.
Q12: Which of the following statements is false?
a. The javac command can compile multiple classes at once; simply list the source-code filenames after the co

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

Describe new developments in the design of pay structures. page 475

Answered: 1 week ago