Using LABVIEW Sum of X to the power i I 1 to N Do not use

Using ----------- LABVIEW!!

Sum of X to the power i; I = 1 to N (Do not use the in-built function. Use two For Loops. Outer For Loop will add the products together; Inner Loop will get the product).

Solution

import java.util.*;

public category ArrayListExample i am attending to add String
*elements therefore I created it of string kind */
   ArrayList<String> obj = new ArrayList<String>();

   /*This is however components ought to be value-added to the array list*/
   obj.add(\"Ajeet\");
   obj.add(\"Harry\");
   obj.add(\"Chaitanya\");
   obj.add(\"Steve\");
   obj.add(\"Anuj\");

   /* Displaying array list components */
   System.out.println(\"Currently the array list has following elements:\"+obj);

   /*Add part at the given index*/
   obj.add(0, \"Rahul\");
   obj.add(1, \"Justin\");

   /*Remove components from array list like this*/
   obj.remove(\"Chaitanya\");
   obj.remove(\"Harry\");

   System.out.println(\"Current array list is:\"+obj);

   /*Remove part from the given index*/
   obj.remove(1);

   System.out.println(\"Current array list is:\"+obj);
}
}
Output:

Currently the array list has following elements:[Ajeet, Harry, Chaitanya, Steve, Anuj]
Current array list is:[Rahul, Justin, Ajeet, Steve, Anuj]
Current array list is:[Rahul, Ajeet, Steve, Anuj]
Methods of ArrayList category

In the on top of example we\'ve got used ways like add and take away. but there square measure range of ways accessible which may be used directly exploitation object of ArrayList category. Let’s discuss few of the necessary ways.

1) add( Object o): This methodology adds Associate in Nursing object o to the arraylist.

obj.add(\"hello\");
This statement would add a string how-do-you-do within the arraylist ultimately position.

2) add(int index, Object o): It adds the item o to the array list at the given index.

obj.add(2, \"bye\");
It will add the string bye to the 2d index (3rd position because the array list starts with index 0) of array list.

3) remove(Object o): Removes the item o from the ArrayList.

Using ----------- LABVIEW!! Sum of X to the power i; I = 1 to N (Do not use the in-built function. Use two For Loops. Outer For Loop will add the products toget

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site