SlideShare a Scribd company logo
sumOfSquares
import java.util.*;
public class Arraylistoperation
{
public static void main(String args[])
{
ArrayList list = createSquaresList(10);
printList(list);
}
public static ArrayList createSquaresList(int n)
{
ArrayList squares= new ArrayList<>();
double s = 0.0;
for (double i = 0.0; i <= n-1; i++)
{
s = i*i;
squares.add(s);
}
return squares;
for(int i = 0; i < m.size(); i++)
{
s+= m.get(i);
}
return s;
}
}
Like wise sumOfCubes
Solution
sumOfSquares
import java.util.*;
public class Arraylistoperation
{
public static void main(String args[])
{
ArrayList list = createSquaresList(10);
printList(list);
}
public static ArrayList createSquaresList(int n)
{
ArrayList squares= new ArrayList<>();
double s = 0.0;
for (double i = 0.0; i <= n-1; i++)
{
s = i*i;
squares.add(s);
}
return squares;
for(int i = 0; i < m.size(); i++)
{
s+= m.get(i);
}
return s;
}
}
Like wise sumOfCubes

More Related Content

Similar to sumOfSquaresimport java.util.;public class Arraylistoperation.pdf

OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
akkhan101
 
Beyond Scala Lens
Beyond Scala LensBeyond Scala Lens
Beyond Scala Lens
Julien Truffaut
 
Data Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptxData Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptx
RashidFaridChishti
 
lec6.ppt
lec6.pptlec6.ppt
lec6.ppt
cawarir
 
Engineering lecture ppt by venay magen
Engineering lecture ppt by venay magenEngineering lecture ppt by venay magen
Engineering lecture ppt by venay magen
venaymagen19
 
Hi, Please find my code##### Sequence.java ##############import.pdf
Hi, Please find my code##### Sequence.java ##############import.pdfHi, Please find my code##### Sequence.java ##############import.pdf
Hi, Please find my code##### Sequence.java ##############import.pdf
anandmobile
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
freddysarabia1
 
Write a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docxWrite a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docx
alexandernmeredith30
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
Sergey Shishkin
 
Les nouveautés de C# 6
Les nouveautés de C# 6Les nouveautés de C# 6
Les nouveautés de C# 6
Microsoft
 
import java.util.ArrayList;public class Checkout{private.docx
import java.util.ArrayList;public class Checkout{private.docximport java.util.ArrayList;public class Checkout{private.docx
import java.util.ArrayList;public class Checkout{private.docx
Abhinav816839
 
Software Design Thinking
Software Design ThinkingSoftware Design Thinking
Software Design Thinking
GeekNightHyderabad
 
Hi, Please find my codeimport java.util.Random;public class Pro.pdf
Hi, Please find my codeimport java.util.Random;public class Pro.pdfHi, Please find my codeimport java.util.Random;public class Pro.pdf
Hi, Please find my codeimport java.util.Random;public class Pro.pdf
anujsharmaanuj14
 
Collection Core Concept
Collection Core ConceptCollection Core Concept
Collection Core Concept
Rays Technologies
 
ISCP internal.pdf
ISCP internal.pdfISCP internal.pdf
ISCP internal.pdf
GANDHAMKUMAR2
 
Huraira_waris_Assgnment_4.docx
Huraira_waris_Assgnment_4.docxHuraira_waris_Assgnment_4.docx
Huraira_waris_Assgnment_4.docx
hurairawarisarain23
 
Lab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docx
Lab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docxLab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docx
Lab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docx
rennaknapp
 

Similar to sumOfSquaresimport java.util.;public class Arraylistoperation.pdf (20)

OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
 
Beyond Scala Lens
Beyond Scala LensBeyond Scala Lens
Beyond Scala Lens
 
Google Guava
Google GuavaGoogle Guava
Google Guava
 
Data Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptxData Structures and Agorithm: DS 02 Array List.pptx
Data Structures and Agorithm: DS 02 Array List.pptx
 
lec6.ppt
lec6.pptlec6.ppt
lec6.ppt
 
Engineering lecture ppt by venay magen
Engineering lecture ppt by venay magenEngineering lecture ppt by venay magen
Engineering lecture ppt by venay magen
 
Hi, Please find my code##### Sequence.java ##############import.pdf
Hi, Please find my code##### Sequence.java ##############import.pdfHi, Please find my code##### Sequence.java ##############import.pdf
Hi, Please find my code##### Sequence.java ##############import.pdf
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 
Write a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docxWrite a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docx
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
 
Les nouveautés de C# 6
Les nouveautés de C# 6Les nouveautés de C# 6
Les nouveautés de C# 6
 
import java.util.ArrayList;public class Checkout{private.docx
import java.util.ArrayList;public class Checkout{private.docximport java.util.ArrayList;public class Checkout{private.docx
import java.util.ArrayList;public class Checkout{private.docx
 
CSharp v1.0.2
CSharp v1.0.2CSharp v1.0.2
CSharp v1.0.2
 
Software Design Thinking
Software Design ThinkingSoftware Design Thinking
Software Design Thinking
 
Hi, Please find my codeimport java.util.Random;public class Pro.pdf
Hi, Please find my codeimport java.util.Random;public class Pro.pdfHi, Please find my codeimport java.util.Random;public class Pro.pdf
Hi, Please find my codeimport java.util.Random;public class Pro.pdf
 
Collection Core Concept
Collection Core ConceptCollection Core Concept
Collection Core Concept
 
ISCP internal.pdf
ISCP internal.pdfISCP internal.pdf
ISCP internal.pdf
 
Huraira_waris_Assgnment_4.docx
Huraira_waris_Assgnment_4.docxHuraira_waris_Assgnment_4.docx
Huraira_waris_Assgnment_4.docx
 
Lab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docx
Lab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docxLab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docx
Lab_3- Objective- Experiment with Lists- Stacks- and Queues- Simulate.docx
 
Oop lecture7
Oop lecture7Oop lecture7
Oop lecture7
 

More from ankit482504

57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf
57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf
57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf
ankit482504
 
9The von Neumann equation for time evolution10Solution9T.pdf
9The von Neumann equation for time evolution10Solution9T.pdf9The von Neumann equation for time evolution10Solution9T.pdf
9The von Neumann equation for time evolution10Solution9T.pdf
ankit482504
 
27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf
27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf
27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf
ankit482504
 
Nature of the reports produced. Financial accounting reports tend to.pdf
  Nature of the reports produced. Financial accounting reports tend to.pdf  Nature of the reports produced. Financial accounting reports tend to.pdf
Nature of the reports produced. Financial accounting reports tend to.pdf
ankit482504
 
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
ankit482504
 
Step1 Fe is oxidised ; its oxidation state change.pdf
                     Step1 Fe is oxidised ; its oxidation state change.pdf                     Step1 Fe is oxidised ; its oxidation state change.pdf
Step1 Fe is oxidised ; its oxidation state change.pdf
ankit482504
 
The process of performing the procedure known as a Tracheostomy is c.pdf
The process of performing the procedure known as a Tracheostomy is c.pdfThe process of performing the procedure known as a Tracheostomy is c.pdf
The process of performing the procedure known as a Tracheostomy is c.pdf
ankit482504
 
The Nixon shockwas a series of economic measures undertaken by Unite.pdf
The Nixon shockwas a series of economic measures undertaken by Unite.pdfThe Nixon shockwas a series of economic measures undertaken by Unite.pdf
The Nixon shockwas a series of economic measures undertaken by Unite.pdf
ankit482504
 
The IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdf
The IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdfThe IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdf
The IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdf
ankit482504
 
Secant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdf
Secant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdfSecant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdf
Secant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdf
ankit482504
 
Ro is the reproduction number. It gives the average number of people.pdf
Ro is the reproduction number. It gives the average number of people.pdfRo is the reproduction number. It gives the average number of people.pdf
Ro is the reproduction number. It gives the average number of people.pdf
ankit482504
 
the salt bridge acts as a porous wall between the.pdf
                     the salt bridge acts as a porous wall between the.pdf                     the salt bridge acts as a porous wall between the.pdf
the salt bridge acts as a porous wall between the.pdf
ankit482504
 
metl ion can be Cobalt .pdf
                     metl ion can be Cobalt                           .pdf                     metl ion can be Cobalt                           .pdf
metl ion can be Cobalt .pdf
ankit482504
 
solution or homogeneous mixture Solution .pdf
                     solution or homogeneous mixture Solution     .pdf                     solution or homogeneous mixture Solution     .pdf
solution or homogeneous mixture Solution .pdf
ankit482504
 
Look at the Periodic Table. Elements are more me.pdf
                     Look at the Periodic Table.  Elements are more me.pdf                     Look at the Periodic Table.  Elements are more me.pdf
Look at the Periodic Table. Elements are more me.pdf
ankit482504
 
Kcl RbNO3 NaCl .pdf
                     Kcl RbNO3 NaCl                                   .pdf                     Kcl RbNO3 NaCl                                   .pdf
Kcl RbNO3 NaCl .pdf
ankit482504
 
HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf
                     HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf                     HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf
HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf
ankit482504
 
CCl4 because it has for bond pairs and 0 lone pai.pdf
                     CCl4 because it has for bond pairs and 0 lone pai.pdf                     CCl4 because it has for bond pairs and 0 lone pai.pdf
CCl4 because it has for bond pairs and 0 lone pai.pdf
ankit482504
 
C) each nitrogen has one nonbinding electron pair.pdf
                     C) each nitrogen has one nonbinding electron pair.pdf                     C) each nitrogen has one nonbinding electron pair.pdf
C) each nitrogen has one nonbinding electron pair.pdf
ankit482504
 
b.Ignore the fact that the orbitals for carbon an.pdf
                     b.Ignore the fact that the orbitals for carbon an.pdf                     b.Ignore the fact that the orbitals for carbon an.pdf
b.Ignore the fact that the orbitals for carbon an.pdf
ankit482504
 

More from ankit482504 (20)

57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf
57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf
57. Howard Florey 58. Albert Schatz 59. Ernst Boris Chain - .pdf
 
9The von Neumann equation for time evolution10Solution9T.pdf
9The von Neumann equation for time evolution10Solution9T.pdf9The von Neumann equation for time evolution10Solution9T.pdf
9The von Neumann equation for time evolution10Solution9T.pdf
 
27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf
27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf
27. Microtubules- made of Tubulidentata and present in cytoplasm28.pdf
 
Nature of the reports produced. Financial accounting reports tend to.pdf
  Nature of the reports produced. Financial accounting reports tend to.pdf  Nature of the reports produced. Financial accounting reports tend to.pdf
Nature of the reports produced. Financial accounting reports tend to.pdf
 
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
1.5 Legal Labels in Verilog areSystem Verilog extends it and al.pdf
 
Step1 Fe is oxidised ; its oxidation state change.pdf
                     Step1 Fe is oxidised ; its oxidation state change.pdf                     Step1 Fe is oxidised ; its oxidation state change.pdf
Step1 Fe is oxidised ; its oxidation state change.pdf
 
The process of performing the procedure known as a Tracheostomy is c.pdf
The process of performing the procedure known as a Tracheostomy is c.pdfThe process of performing the procedure known as a Tracheostomy is c.pdf
The process of performing the procedure known as a Tracheostomy is c.pdf
 
The Nixon shockwas a series of economic measures undertaken by Unite.pdf
The Nixon shockwas a series of economic measures undertaken by Unite.pdfThe Nixon shockwas a series of economic measures undertaken by Unite.pdf
The Nixon shockwas a series of economic measures undertaken by Unite.pdf
 
The IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdf
The IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdfThe IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdf
The IUPAC names of the above compounds areZ-4,5-dichloro pent-4-e.pdf
 
Secant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdf
Secant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdfSecant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdf
Secant is 1cosineRangeof cosine is(-1,1)Secant function cannot .pdf
 
Ro is the reproduction number. It gives the average number of people.pdf
Ro is the reproduction number. It gives the average number of people.pdfRo is the reproduction number. It gives the average number of people.pdf
Ro is the reproduction number. It gives the average number of people.pdf
 
the salt bridge acts as a porous wall between the.pdf
                     the salt bridge acts as a porous wall between the.pdf                     the salt bridge acts as a porous wall between the.pdf
the salt bridge acts as a porous wall between the.pdf
 
metl ion can be Cobalt .pdf
                     metl ion can be Cobalt                           .pdf                     metl ion can be Cobalt                           .pdf
metl ion can be Cobalt .pdf
 
solution or homogeneous mixture Solution .pdf
                     solution or homogeneous mixture Solution     .pdf                     solution or homogeneous mixture Solution     .pdf
solution or homogeneous mixture Solution .pdf
 
Look at the Periodic Table. Elements are more me.pdf
                     Look at the Periodic Table.  Elements are more me.pdf                     Look at the Periodic Table.  Elements are more me.pdf
Look at the Periodic Table. Elements are more me.pdf
 
Kcl RbNO3 NaCl .pdf
                     Kcl RbNO3 NaCl                                   .pdf                     Kcl RbNO3 NaCl                                   .pdf
Kcl RbNO3 NaCl .pdf
 
HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf
                     HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf                     HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf
HOAc + NAOH = OAc- + H2O 0.1 0.03 0.07 0 0.03 pH .pdf
 
CCl4 because it has for bond pairs and 0 lone pai.pdf
                     CCl4 because it has for bond pairs and 0 lone pai.pdf                     CCl4 because it has for bond pairs and 0 lone pai.pdf
CCl4 because it has for bond pairs and 0 lone pai.pdf
 
C) each nitrogen has one nonbinding electron pair.pdf
                     C) each nitrogen has one nonbinding electron pair.pdf                     C) each nitrogen has one nonbinding electron pair.pdf
C) each nitrogen has one nonbinding electron pair.pdf
 
b.Ignore the fact that the orbitals for carbon an.pdf
                     b.Ignore the fact that the orbitals for carbon an.pdf                     b.Ignore the fact that the orbitals for carbon an.pdf
b.Ignore the fact that the orbitals for carbon an.pdf
 

Recently uploaded

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 

Recently uploaded (20)

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 

sumOfSquaresimport java.util.;public class Arraylistoperation.pdf

  • 1. sumOfSquares import java.util.*; public class Arraylistoperation { public static void main(String args[]) { ArrayList list = createSquaresList(10); printList(list); } public static ArrayList createSquaresList(int n) { ArrayList squares= new ArrayList<>(); double s = 0.0; for (double i = 0.0; i <= n-1; i++) { s = i*i; squares.add(s); } return squares; for(int i = 0; i < m.size(); i++) { s+= m.get(i); } return s; } } Like wise sumOfCubes Solution sumOfSquares
  • 2. import java.util.*; public class Arraylistoperation { public static void main(String args[]) { ArrayList list = createSquaresList(10); printList(list); } public static ArrayList createSquaresList(int n) { ArrayList squares= new ArrayList<>(); double s = 0.0; for (double i = 0.0; i <= n-1; i++) { s = i*i; squares.add(s); } return squares; for(int i = 0; i < m.size(); i++) { s+= m.get(i); } return s; } } Like wise sumOfCubes