SlideShare a Scribd company logo
1 of 2
Download to read offline
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.pdfakkhan101
 
lec6.ppt
lec6.pptlec6.ppt
lec6.pptcawarir
 
Engineering lecture ppt by venay magen
Engineering lecture ppt by venay magenEngineering lecture ppt by venay magen
Engineering lecture ppt by venay magenvenaymagen19
 
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.pdfanandmobile
 
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.pdffreddysarabia1
 
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.docxalexandernmeredith30
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingSergey Shishkin
 
Les nouveautés de C# 6
Les nouveautés de C# 6Les nouveautés de C# 6
Les nouveautés de C# 6Microsoft
 
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.docxAbhinav816839
 
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.pdfanujsharmaanuj14
 
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.docxrennaknapp
 
Java весна 2013 лекция 2
Java весна 2013 лекция 2Java весна 2013 лекция 2
Java весна 2013 лекция 2Technopark
 

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
 
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
 
Java весна 2013 лекция 2
Java весна 2013 лекция 2Java весна 2013 лекция 2
Java весна 2013 лекция 2
 

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 - .pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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 .pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
metl ion can be Cobalt .pdf
                     metl ion can be Cobalt                           .pdf                     metl ion can be Cobalt                           .pdf
metl ion can be Cobalt .pdfankit482504
 
solution or homogeneous mixture Solution .pdf
                     solution or homogeneous mixture Solution     .pdf                     solution or homogeneous mixture Solution     .pdf
solution or homogeneous mixture Solution .pdfankit482504
 
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.pdfankit482504
 
Kcl RbNO3 NaCl .pdf
                     Kcl RbNO3 NaCl                                   .pdf                     Kcl RbNO3 NaCl                                   .pdf
Kcl RbNO3 NaCl .pdfankit482504
 
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 .pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 
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.pdfankit482504
 

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 Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

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