Answered step by step
Verified Expert Solution
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 formatCheck the sample input file, sample.txt containing tens of multiplechoice questionsassume N questions and the correct answer to each question. then the user determines how many booklets assume m with how many questionsassume nN should be generated. As the output file, the program generates 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.
Q: 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
Q: You can declare new classes as needed; this is one reason Java is known as an language.
a portable
b incremental
c extensible
d virtual
ANS: c
Q: 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
Q: 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
Q: Which of the following statements is true?
a Each object instance of the class shares the classs instance variables.
b Most instancevariable 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
Q: When a method terminates, the values of its local variables are
a saved
b copied
c restored
d lost
ANS: d
Q: 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
Q: 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
Q: A class that creates an object of another class, then calls the objects methods, is called an class.
a objectoriented
b inherited
c caller
d driver.
ANS: d
Q: Which of the following statements is false?
a Scanner method next reads characters until any whitespace 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
Q: 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
Q: Which of the following statements is false?
a The javac command can compile multiple classes at once; simply list the sourcecode filenames after the co
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started