Skip to main content

Accenture TFA Quiz | Part 2

 

Question 26

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

public class ApplicationTester 
{ 
  public static void main(String[] args)
  { 
    int[] array = {11,22,33,44,55,11}; 
    int searchNumber = 11, position=999;
    for(int index=0; index < array.length; index++)
    { 
      if(searchNumber == array[index])
      { 
        position = index; 
      } 
    } System.out.println(position); 
  }
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 27

Incorrect
Marked out of 1
Flag question

Question text

Predict the line of code

 Abstract class  Base1
{
    protected void getDetails()
    {
        System.out.println("Base method");
    }
    public Abstract void demomethod();
}
Abstract class Base2 extends Base1
{
   public Abstract void samplemethod();   
}
class Derived extends Base2
{
    //Line1
}

Select one:
 

Feedback

Question 28

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

 public class MyClass 
{ 
  private static int data; 
  static
  { 
    MyClass.data = 999; 
  } 
  public static int getData() 
  { 
    return data; 
  } 
  public static void setData(int data) 
  {
    MyClass.data = data; 
  } 
} 
public class ApplicationTester 
{
  public static void main(String[] args)
  { 
    MyClass ref1 = new MyClass(); 
    MyClass ref2 = new MyClass();
    System.out.print(ref1.getData()); 
    ref2.setData(111); 
    System.out.println(" " + ref1.getData());
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 29

Correct
Marked out of 1
Flag question

Question text

Accenture developed a Java based Application (Vendor Management System) for New Codington city. The product was delivered to New Codington after successful testing on Windows platform. New Codington wants to run the application on their desktop which has Linux platform. What are the MINIMUM resources needed to successfully run the application? Choose the most appropriate option.

Select one:
 

Feedback

Question 30

Incorrect
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

public interface MyInterface 
{ 
  int MY_DATA = 100; public void display(); 
} 
public class MyClass implements MyInterface
{
public MyClass()
{ 
MyInterface.MY_DATA = 200; 
//Line-1 
}
public void display()
{ 
System.out.println(MyInterface.MY_DATA); 
} 
} 
public class ApplicationTester 
{ 
  public static void main(String[] args)
  { 
    MyInterface ref = new MyClass(); 
    //Line-2 ref.display(); 
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 31

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

 public class StringTester
 { 
   public static void main(String[] args) 
   { 
     String s1=new String("Accenture"); 
     String s2=new String("India Limited");
     s1.concat(s2); 
     System.out.println(s1); 
   } 
 }
Choose the most appropriate option.

Select one:
 

Feedback

Question 32

Correct
Marked out of 1
Flag question

Question text

Consider the Java code given below. After the execution of the code what will be the content of "array2 "?

public class Tester
{ 
  public static void main(String[] args)
  {
    int array1[] = {71,12,23,34}; 
    int array2[] = new int[4]; 
    int count = 0; 
    for (int i = 0; i < array2.length; i++) 
    { 
      if(array1[i]%2==0)
      { 
        array2[count]=array1[i]; 
        count++; 
      } 
    } 
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 33

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

Employee.java public class Employee 
{ 
  private double salary; 
  public Employee()
  { 
    this.salary = 10000.0; 
  }
  public static void updateSalary(Employee emp)
  {
    emp.salary = emp.salary + 10000.0;
    //Line-1
  } 
  public double getSalary()
  {
    return this.salary; 
  } 
} 
ApplicationTester .java public class ApplicationTester 
{ 
  public static void main(String[] args)
  { 
    Employee emp1 = new Employee();
    Employee emp2 = new Employee(); 
    Employee.updateSalary(emp1);
    System.out.println(emp1.getSalary() + " " + emp2.getSalary()); 
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 34

Incorrect
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

 
public class ApplicationTester 
 { 
   public static void main(String[] args)
   { 
     int[] array = {-9,-11-8,-100,-78}; 
     int minimum = 0; 
     for(int index=0; index < array.length; index++)
     { 
       if(minimum < array[index])
       { minimum = array[index]; 
       }
     }
     System.out.println(minimum); 
   } 
 }
Choose the most appropriate option.

Select one:
 

Feedback

Question 35

Correct
Marked out of 1
Flag question

Question text

What is the output of the following code?

class Account 
 { 
   int balance; 
   public void createAccount() 
   { 
     balance = 1000; 
   } 
   public int getMinimumBalance() 
   { 
     return balance;
   } 
 } 
class SalaryAccount extends Account 
{ 
private String companyName;
public SalaryAccount(String companyName) 
{ 
this.companyName = companyName; 
}
public void createAccount() 
{ 
balance = 500; 
} 
public void checkCompany() 
{
if (companyName.equalsIgnoreCase("Accenture")) 
{ 
balance = 0;
} 
} 
} 
public class MainClass 
{ 
  public static void main(String[] args)
  { 
    Account account = new SalaryAccount("Accenture"); 
    account.createAccount(); 
    System.out.println("Balance : " + account.getMinimumBalance());
    account.checkCompany();
    System.out.println("Balance : " + account.getMinimumBalance());
  } 
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 36

Correct
Marked out of 1
Flag question

Question text

What will be the output of the following Java code?

public class Account 
{ 
  public void deposite(int amount)
  { 
    System.out.println("Account deposited with: " + amount); 
  }
  public void transaction()
  {
    this.deposite(100); 
  } 
}
public class SavingsAccount extends Account
{
public void deposite(int amount)
{ 
System.out.println("Savings Account deposited with: " + amount); 
} 
} 
public class ApplicationTester 
{ 
  public static void main(String[] args)
  { 
    Account account = new SavingsAccount();
    account.transaction();
  }
}
Choose the most appropriate option.

Select one:
 

Feedback

Question 37

Correct
Marked out of 1
Flag question

Question text

Johana wants to display "Welcome to JS!!" as a pop up message using JavaScript. Which of the following suits her requirement?

Select one:
 

Feedback

Question 38

Correct
Marked out of 1
Flag question

Question text

which of the following code creates a list box from which user can select more than one option?

Select one:
 

Feedback

Question 39

Correct
Marked out of 1
Flag question

Question text

Which of the following attribute is used by a HTML tag to apply inline style? Choose most appropriate option.

Select one:
 

Feedback

Question 40

Incorrect
Marked out of 1
Flag question

Question text

Refer to the below code:

<script> 
function helloMessage(){ 
  var jsName = //Line1 alert('Hello '+jsName+' !') 
} 
</script> 
<form>
Enter First Name : <input type="text" name="firstName" id="first"><br> 
<input type="button" value="Click Here!" onclick="helloMessage()"> 
</form>
Which is the CORRECT code to be inserted at "Line1" to make the JavaScript run properly? Choose most appropriate option

Select one:
 

Feedback

Question 41

Incorrect
Marked out of 1
Flag question

Question text

What would be the output of the following Java Script?

<html>
 <body>
  <script> 
   var key1=1; document.write(typeof(key1) + " "); 
   var key2=null; document.write(typeof(key2)); 
 </script> 
</body> 
</html>
Choose most appropriate option.

Select one:
 

Feedback

Question 42

Correct
Marked out of 1
Flag question

Question text

Which attribute of the form specifies the name of the web page on the server which will process the form after submission? Choose most appropriate option.

Select one:
 

Feedback

Question 43

Correct
Marked out of 1
Flag question

Question text

Which of the following is the correct html form element to create the checkbox in a web page? Choose most appropriate option.

Select one:
 

Feedback

Question 44

Correct
Marked out of 1
Flag question

Question text

<!DOCTYPE html>
 <html>
 <body> 
  <script> 
  var x = (3 + 3) + 4 + "6"; alert(x);//line 1 
  </script>
 </body> 
</html>
What will be printed in alert box in line 1? Choose most appropriate option.

Select one:
 

Feedback

Question 45

Correct
Marked out of 1
Flag question

Question text

In HTML, Which of the following is used to merge columns in a table? Choose most appropriate option.

Select one:
 

Feedback

Question 46

Incorrect
Marked out of 1
Flag question

Question text

What would be the Output of the below java script Code?

<html> <body>
<script>
 var x = 5; var d = (x != "5"); 
document.write(d +"--"); 
d = (x === "5"); document.write(d); 
</script> </body>
</html>
Choose most appropriate option.

Select one:
 

Feedback

Question 47

Correct
Marked out of 1
Flag question

Question text

Which method is used to remove focus from the specified object? Choose most appropriate option.

Select one:
 

Feedback

Question 48

Correct
Marked out of 1
Flag question

Question text

Consider the javascript code given below. What would be the print values from line 1 and line 2 on execution?


<html> 

   <body> 

     <p id="id1"></p><!-- line 1--> 

     <p id="id2"></p><!-- line 2-->

     <script>

       var y=10; 

       myFunction();

       document.getElementById("id1").innerHTML = y; 

       document.getElementById("id2").innerHTML = window.y;

       function myFunction() {

         y=20; 

         y=y+window.y

       } 

     </script>

   </body> 

</html>


Choose the most appropriate option.

Select one:
 

Feedback

Question 49

Incorrect
Marked out of 1
Flag question

Question text

Consider the HTML code given below.


<html>

  <head>

    <script>

      var key=10;

      function add(){

        var key=20;

        window.key=key+1;

        document.write(key);

        document.write(" ");

        print();

      }

      function print(){

        document.write(key);

      }

    </script>

  </head>

  <body>

    <form>

      <input type="submit" onclick="add()" />

    </form>

  </body>

</html>

 

What will be displayed after executing the above code?

Choose the most appropriate option.

Select one:
 

Feedback

Question 50

Incorrect
Marked out of 1
Flag question

Question text

How many cells will be created after executing the below HTML code?


<html>

<body>

<table border="1">

<tr> <td colspan="3"> Jack </td> </tr>

<tr> <td colspan="2"> Tom </td> <td> Mark </td> </tr>

<tr> <td rowspan="2"> John</td> <td> James</td> <td>Mary</td> </tr>

<tr> <td> Helen</td> <td> Sam </td>  </tr>

</table>

</body>

</html>

Select one:
 

Feedback

Comments

Must Read:

DFA Solutions

  Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text To secure the http messages in the API calls, its necessary to: Select one: a. All the above b. Use cryptography c. implement identity management d. avoid hardcoding any sensitive data in the messages Feedback The correct answer is: All the above Question  2 Correct Mark 1.00 out of 1.00 Remove flag Question text A team has completed 10 Sprints and moving to the 11th Sprint. Till Sprint 10, the team has achieved an average of 50 story points per sprint. The same is projected as their velocity for the upcoming sprints with the Client. What is this approach called? Select one: a. Velocity Driven Sprint Planning b. Velocity Driven Commitment c. Commitment Driven Velocity d. Commitment Driven Sprint Planning Feedback The correct answer is: Velocity Driven Sprint Planning Question  3 Incorrect Mark 0.00 out of 1.00 Remove flag Question text Jack is grooming himself to be a potential Product Owner. Kno...

Accenture TFA MCQ | Part 2

  Question  26 Incorrect Mark 0.00 out of 1.00 Flag question Question text Go-Will department store wants to automate few of its functionalities.From the below options identify the functional requirements of Go-Will department store Select one or more: a.  Generate Bill for the purchased Items   b.  Add Product Details   c.  System should be up and running 24/7   d.  Response for each button click should be within 3 seconds   Feedback The correct answers are: Generate Bill for the purchased Items, Add Product Details Question  27 Incorrect Mark 0.00 out of 1.00 Flag question Question text A website for Flight Booking was developed and given to the testing team for testing. It has various fields to enter the data, out of which one of the input field will take the birth year from the user ranging from 1980 to 2060. The boundary values for testing this field are? Select one: a.  1959, 1960, 1994, 1995 b.  0, 1959, 1960, 1961,...

Data Formats ( XML & JSON ) XML AND JSON | Generate XSD for Students

  Generate XSD for Students   Generate XSD for the following XML. XYZ School wants to store the details of students in an xml file. The following scenario helps in designing the XML document. Here StudentList  is the root tag. StudentList contains the entry of each student with rollno, name, age, address and department. <?xml version="1.0" encoding="UTF-8"?> <StudentList  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="StudentList.xsd">     <Student rollno="2017CSE0055">         <name>             <firstname>Savitha</firstname>         </name>         <age>20</age>         <address>             <doorno>35</doorno>     ...

Accenture TFA MCQ | Part 1

Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text   Identify whether the below statement is True or False: The hierarchy of Reader/Writer class is character-oriented and InputStream/OutputStream class is byte-oriented Select one: True   False Feedback The correct answer is 'True'. Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text While garbage collection the java run time system automatically calls ______________method. Select one: a.  finalize()   b.  finalizer() c.  finally() d.  finalized() Feedback The correct answer is: finalize() Question  3 Partially correct Mark 0.67 out of 1.00 Flag question Question text Choose all the statement(s) that are valid. Select one or more: a.  There is only single copy of member function in memory when a class is loaded b.  A super class is an incomplete class that requires further specification c.  Two classes in two different packages can have ...

UNIX Introduction to Unix | Test Your Understanding - Introduction to Unix

 UNIX  Introduction to Unix  Test Your Understanding - Introduction to Unix Feedback Congratulations! You have passed by securing more that 80%. Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text What will be the output of the given code snippet? ~]$ dc 4 5 + 3 p   blank         5 4 3 8 Feedback Your answer is correct. The correct answer is: What will be the output of the given code snippet? ~]$ dc 4 5 + 3 p [3] Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text Fill the specific date format in the given echo statement, to print the date in dd/mm/yyyy format.  echo `date +   blank   /   blank   /   blank   `           %m %dd %d %y %M %Y Feedback Your answer is correct. The correct answer is: Fill the specific date format in the given echo statement, to print the date in dd/mm/yyyy format.  echo `date +[%d]/[%m]/[%Y]`

RDBMS Data Definition Language | Create Buses table

 efer the below schema and create the buses table. Column Name Datatype Size Constraint Constraint name Bus_no Number 11 Primary key PK_BUSES Bus_name Varchar2 20   Type Varchar2 20   Total_seats Number 11   Avail_seats Number 11     Result Description Summary of tests +------------------------------+ | 3 tests run / 3 test passed | +------------------------------+

RDBMS Data Definition Language | Create Distributor table

  Write a query to create Distributor table with constraints mentioned.  Refer the below schema  Result Description Summary of tests +------------------------------+ | 3 tests run / 3 test passed | +------------------------------+

Zero One Knapsack | Recursion

 1. You are given a number n, representing the count of items. 2. You are given n numbers, representing the values of n items. 3. You are given n numbers, representing the weights of n items. 3. You are given a number "cap", which is the capacity of a bag you've. 4. You are required to calculate and print the maximum value that can be created in the bag without       overflowing it's capacity. Note: Each item can be taken 0 or 1 number of times. You are not allowed to put the same item again and again. Input Format A number n v1 v2 .. n number of elements w1 w2 .. n number of elements A number cap Output Format A number representing the maximum value that can be created in the bag without overflowing it's capacity Constraints 1 <= n <= 20 0 <= v1, v2, .. n elements <= 50 0 < w1, w2, .. n elements <= 10 0 < cap <= 10 Sample Input 5 15 14 10 45 30 2 5 1 3 4 7 Sample Output 75 Solution: import java.io.*; import java.util.*; public class Main...

Accenture Mock Quiz | Part 1

Question  1 Incorrect Marked out of 1.00 Remove flag Question text Select the true statement ? Select one: a.  Inheritance forms a is-a part of relationship between classes.   b.  Aggregation is the stronger form of Inheritance. c.  Aggregation forms the is-a type of relationship between classes. d.  Aggregation forms a is-a part of relationship between classes. Composition is the stronger form of Aggregation. Feedback The correct answer is: Aggregation forms a is-a part of relationship between classes. Composition is the stronger form of Aggregation. Question  2 Correct Marked out of 1.00 Flag question Question text What is the diagram that depicts the interaction between objects by arranging the objects in time sequence ? Select one: a.  Use Case Diagram b.  Sequence Diagram   c.  Component Diagram d.  Activity Diagram Feedback The correct answer is: Sequence Diagram Question  3 Incorrect Marked out of 1.00 Flag question...

Subscribe to Get's Answer by Email