Code Quality MCQ


Code Quality Multiple Choice Questions with answers | Code Quality MCQs with answer | Code Quality Objective Type questions | Code Quality Accenture TQ Answers

1.Shelly is working on a .NET application. She needs help to identify the correct format of the writing class or struct level constants that are publicly visible from the options below

A.currentYear
B.Current_YEAR
C.CURRENTYEAR
D.CURRENT YEAR

Ans: B

2.Jenny needs to add Structured Query Language (SQL) queries to an SQL program. Identity the correct guidelines that she should follow from the options below

A.Type all the SQL quenes in the uppercase
B.Type the reserved words in the uppercase
C.Group the columns logically in all the statements (The primary keys should follow the data columns)
D.Enclose the condition in brackets, and indent the condition for complex conditions involving AND and OR

Ans: B,C,D

3.Paul is working on the core complexity code, which deals with the salary calculation and processing. In the code snippet below, select the correct sequence of the logging statement and click Submit

private void calculate Salary (String employeeld) {

(1)

int salary = 0 , // Salary variable

// multiple coding statements for calculations of Salary (identified by variable salary)

(2)

// multiple coding statements

(3)

Ans: A. logger info Entering the method-calculateSalary()”); B. logger info(“Salary of Employee is “+ salary);

4.Harry is working on a Java application. He encounters a NullPointer exception. Identify the solution from the options below to avoid the NullPointer exception in the following code.

If (employee.getDepartmentName().equals(“FINANCE”){ //code statements


}

You can select only one option. Click Submit once complete.

A.First, use the constant to avoid a NullPointer exception.
B.Code the statement correctly
C.Use the operator instead of equals()
D.Use the operator instead of equals()

Ans: A.

5.Which of the following expressions is correct for adding three numbers, then dividing their sum by 100, followed by multiplying the result by 10, and then adding 50?
You can select only one option. Click Submit once complete.

A.a + b + c / 100 * 10 + 50
B.(a + b + c) / 100 + 50 deg * 10
C.(((a + b + c) / 100) * 10) + 50
D.a + b + c / 100 + 50 deg * 10

Ans: C

6.Identify the loop and its appropriate use. Select the correct option and click Submit

Ans – The until loop- Choose this loop if you want the loop to iterate at least once The for loop-Choose this loop only when the counter determines an end condition The while loop-Choose this loop to test the exit condition at the beginning or at the end

7.Which of these methods are used to reduce object creation?You can select more than one option. Click Submit once complete.

A.Avoid creating objects in loops wherever possible
B.Perform lazy initialization.
C.Implement object pooling and recycling
D.Cache the data

Ans: A,B,C

8.Selecting the appropriate algorithms during the Design phase helps to achieve optimization.

A.False
B.True

Ans: True

9.Software quality tools assume the role of aYou can select only one option Click Submit once complete.

A.Moderator
B.Author
C.Manager
D.Reviewer

Ans: C


Leave a Reply

Your email address will not be published. Required fields are marked *