Software Engineering-I MCQs with Answers
Practice important Software Engineering-I MCQs with answers and explanations.
Chapter: 28
Q501:
Which naming convention combines information about the variable in its name?
A. Hungarian Notation
B. CamelCase
C. Constant Naming
D. Function Naming
Correct Answer:
A
Chapter: 28
Q502:
CamelCase is now the official convention for which programming language?
A. C++
B. Python
C. Java
D. C#
Correct Answer:
C
Chapter: 28
Q503:
Constants in Java should be written in which format?
A. Mixed case
B. Uppercase using underscore
C. Mixed case starting with upper case
D. Lowercase using underscore
Correct Answer:
B
Chapter: 28
Q504:
Which of the following is the proper way to name a method in Java?
A. getName()
B. setName()
C. ComputeName()
D. Get_Name()
Correct Answer:
A
Chapter: 28
Q505:
What is the correct prefix for boolean variables in naming conventions?
A. is
B. has
C. can
D. should
Correct Answer:
A
Chapter: 28
Q506:
Which of the following should be avoided in naming variables?
A. Abbreviations
B. Complete words
C. Descriptive names
D. Identifiers with scope information
Correct Answer:
A
Chapter: 28
Q507:
Using __ as a suffix indicates that a variable represents a number of objects.
A. n
B. nm
C. ni
D. none
Correct Answer:
A
Chapter: 28
Q508:
What should be the format for naming representing types in Java?
A. Uppercase starting with lower case
B. Mixed case starting with upper case
C. All uppercase
D. Lowercase starting with upper case
Correct Answer:
B
Chapter: 28
Q509:
Which prefix indicates a boolean state in variable naming?
A. should
B. can
C. is
D. must
Correct Answer:
C
Chapter: 28
Q510:
What is the preferred way to name a variable representing an employee number?
A. iEmployee
B. empNo
C. employeeNo
D. employee_id
Correct Answer:
A
Chapter: 28
Q511:
Which of the following should NOT be included in variable names according to naming conventions?
A. Domain-specific acronyms
B. Abbreviations
C. Descriptive names
D. Meaningful identifiers
Correct Answer:
B
Chapter: 28
Q512:
Identifiers that represent constants must be written in _______.
A. Uppercase with underscores
B. Mixed case
C. Lowercase
D. Uppercase only
Correct Answer:
A
Chapter: 28
Q513:
Which of the following naming styles is discouraged for boolean variables?
A. isOpen
B. isStatus
C. isFlag
D. hasLicense
Correct Answer:
B
Chapter: 29
Q514:
What is the recommended extension for C++ source files?
A. .h
B. .c++
C. .java
D. .cpp
Correct Answer:
B
Chapter: 29
Q515:
Header files in C++ should include a construction that prevents _________.
A. multiple declarations
B. multiple inclusion
C. code duplication
D. compilation errors
Correct Answer:
B
Chapter: 29
Q516:
What is the proper order for class variables in Java and C++?
A. public, private, protected
B. protected, public, private
C. public, protected, package
D. private, public, protected
Correct Answer:
C
Chapter: 29
Q517:
Fill in the blank: Special characters like _______ and page break must be avoided in file handling.
A. TAB
B. Line break
C. Commas
D. Semicolons
Correct Answer:
A
Chapter: 29
Q518:
In C++, which is the correct way to declare a header file that prevents multiple inclusion?
A. #ifndef MOD_FILENAME_H
B. #define MOD_FILENAME_H
C. #include MOD_FILENAME_H
D. #endif MOD_FILENAME_H
Correct Answer:
A
Chapter: 29
Q519:
What should be avoided when declaring class variables?
A. Public variables
B. Private variables
C. Protected variables
D. Static variables
Correct Answer:
A
Chapter: 29
Q520:
Which type of conversion must always be done explicitly in Java and C++?
A. Implicit type conversion
B. Explicit type conversion
C. Automatic type conversion
D. No conversion needed
Correct Answer:
B