SlideShare une entreprise Scribd logo
1  sur  1
Develop a Java application (ArrayMethods java) that reads 12 integers into an array. The
application should call five static methods (from the main method) that in turn: (1) display all the
integers, (2) display all the integers in reverse order, (3) display the sum of the integers, (4)
display all values less than a limiting argument, and (5) display all values that are higher than the
calculated average value. import java.util.Scanner; public class ArrayMethods{ public static
void main(String[] args) final int L ENGT H = 10 ; int limit = 5 ; int[] intArray = new
int[LENGTH]; Scanner scan = new Scanner ( System.in); System.out.print("Enter 10 integers:
"); for(int i = 0 ; i < LENGTH; i + + )} intArray[i] = scan.nextint(); ) ) ) ) private static int
displaySum(int[] intArr){ } private static void displayAllLessThan(int[] intArr, int lim){ }
private static void displayAverage(int[] intArr){ } private static void
displayAllHigherThanAverage(int[] intArr){ } }

Contenu connexe

Similaire à Develop a Java application (ArrayMethods java) that reads 12 integers.docx

Program 1The following program manipulates array of inte.docx
Program 1The following program manipulates array of inte.docxProgram 1The following program manipulates array of inte.docx
Program 1The following program manipulates array of inte.docx
briancrawford30935
 
Javaa. The mean of a list of numbers is its arithmetic average. T.pdf
Javaa. The mean of a list of numbers is its arithmetic average. T.pdfJavaa. The mean of a list of numbers is its arithmetic average. T.pdf
Javaa. The mean of a list of numbers is its arithmetic average. T.pdf
RAJATCHUGH12
 
import java.util.;public class Program{public static void.pdf
import java.util.;public class Program{public static void.pdfimport java.util.;public class Program{public static void.pdf
import java.util.;public class Program{public static void.pdf
optokunal1
 

Similaire à Develop a Java application (ArrayMethods java) that reads 12 integers.docx (11)

Java: Introduction to Arrays
Java: Introduction to ArraysJava: Introduction to Arrays
Java: Introduction to Arrays
 
JAVA Question : Programming Assignment
JAVA Question : Programming AssignmentJAVA Question : Programming Assignment
JAVA Question : Programming Assignment
 
Program 1The following program manipulates array of inte.docx
Program 1The following program manipulates array of inte.docxProgram 1The following program manipulates array of inte.docx
Program 1The following program manipulates array of inte.docx
 
Javaa. The mean of a list of numbers is its arithmetic average. T.pdf
Javaa. The mean of a list of numbers is its arithmetic average. T.pdfJavaa. The mean of a list of numbers is its arithmetic average. T.pdf
Javaa. The mean of a list of numbers is its arithmetic average. T.pdf
 
GenericsFinal.ppt
GenericsFinal.pptGenericsFinal.ppt
GenericsFinal.ppt
 
Prompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfPrompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdf
 
Oot practical
Oot practicalOot practical
Oot practical
 
import java.util.;public class Program{public static void.pdf
import java.util.;public class Program{public static void.pdfimport java.util.;public class Program{public static void.pdf
import java.util.;public class Program{public static void.pdf
 
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
 
C# p9
C# p9C# p9
C# p9
 
07 Arrays
07 Arrays07 Arrays
07 Arrays
 

Plus de rtodd4

Draw an ER-EER data model for the following scenario- You want to buil.docx
Draw an ER-EER data model for the following scenario- You want to buil.docxDraw an ER-EER data model for the following scenario- You want to buil.docx
Draw an ER-EER data model for the following scenario- You want to buil.docx
rtodd4
 
Draw a flow chart to illustrate the cycle that a grain of sand goes th.docx
Draw a flow chart to illustrate the cycle that a grain of sand goes th.docxDraw a flow chart to illustrate the cycle that a grain of sand goes th.docx
Draw a flow chart to illustrate the cycle that a grain of sand goes th.docx
rtodd4
 

Plus de rtodd4 (20)

E) (4 Points) Consider a simple C program that consists of a function.docx
E) (4 Points) Consider a simple C program that consists of a function.docxE) (4 Points) Consider a simple C program that consists of a function.docx
E) (4 Points) Consider a simple C program that consists of a function.docx
 
During the past decade- hundreds of hospitals have closed- merged- or.docx
During the past decade- hundreds of hospitals have closed- merged- or.docxDuring the past decade- hundreds of hospitals have closed- merged- or.docx
During the past decade- hundreds of hospitals have closed- merged- or.docx
 
During the most recent recession- some economists argued that the chan.docx
During the most recent recession- some economists argued that the chan.docxDuring the most recent recession- some economists argued that the chan.docx
During the most recent recession- some economists argued that the chan.docx
 
During the last year- John has made timely payments on three of his cr.docx
During the last year- John has made timely payments on three of his cr.docxDuring the last year- John has made timely payments on three of his cr.docx
During the last year- John has made timely payments on three of his cr.docx
 
During the 1990 s- Canada suffered a net loss of skilled workers to th.docx
During the 1990 s- Canada suffered a net loss of skilled workers to th.docxDuring the 1990 s- Canada suffered a net loss of skilled workers to th.docx
During the 1990 s- Canada suffered a net loss of skilled workers to th.docx
 
During January- its first month of operations- Keys Company accumulate.docx
During January- its first month of operations- Keys Company accumulate.docxDuring January- its first month of operations- Keys Company accumulate.docx
During January- its first month of operations- Keys Company accumulate.docx
 
Dumpy wings (dp) and brown eyes (bw) are both recessive alleles of Dro.docx
Dumpy wings (dp) and brown eyes (bw) are both recessive alleles of Dro.docxDumpy wings (dp) and brown eyes (bw) are both recessive alleles of Dro.docx
Dumpy wings (dp) and brown eyes (bw) are both recessive alleles of Dro.docx
 
Drosophila have X and Y chromosomes and determine sex in a manner that (1).docx
Drosophila have X and Y chromosomes and determine sex in a manner that (1).docxDrosophila have X and Y chromosomes and determine sex in a manner that (1).docx
Drosophila have X and Y chromosomes and determine sex in a manner that (1).docx
 
Draw your version of the slide below- It's a cross section of the trac.docx
Draw your version of the slide below- It's a cross section of the trac.docxDraw your version of the slide below- It's a cross section of the trac.docx
Draw your version of the slide below- It's a cross section of the trac.docx
 
Draw the relationships between the structure and components and how do.docx
Draw the relationships between the structure and components and how do.docxDraw the relationships between the structure and components and how do.docx
Draw the relationships between the structure and components and how do.docx
 
Draw the diagrams yourself- Do not copy-paste from other sources- Ques.docx
Draw the diagrams yourself- Do not copy-paste from other sources- Ques.docxDraw the diagrams yourself- Do not copy-paste from other sources- Ques.docx
Draw the diagrams yourself- Do not copy-paste from other sources- Ques.docx
 
Draw an ellipse and label earth on the elliptical orbit- sun at a focu.docx
Draw an ellipse and label earth on the elliptical orbit- sun at a focu.docxDraw an ellipse and label earth on the elliptical orbit- sun at a focu.docx
Draw an ellipse and label earth on the elliptical orbit- sun at a focu.docx
 
Draw an ER-EER data model for the following scenario- You want to buil.docx
Draw an ER-EER data model for the following scenario- You want to buil.docxDraw an ER-EER data model for the following scenario- You want to buil.docx
Draw an ER-EER data model for the following scenario- You want to buil.docx
 
Draw a truth table for AB(A+B).docx
Draw a truth table for AB(A+B).docxDraw a truth table for AB(A+B).docx
Draw a truth table for AB(A+B).docx
 
Draw a flow chart to illustrate the cycle that a grain of sand goes th.docx
Draw a flow chart to illustrate the cycle that a grain of sand goes th.docxDraw a flow chart to illustrate the cycle that a grain of sand goes th.docx
Draw a flow chart to illustrate the cycle that a grain of sand goes th.docx
 
Draw a cartoon of Meiosis that depicts the following (9) stages- Inter.docx
Draw a cartoon of Meiosis that depicts the following (9) stages- Inter.docxDraw a cartoon of Meiosis that depicts the following (9) stages- Inter.docx
Draw a cartoon of Meiosis that depicts the following (9) stages- Inter.docx
 
Draw a compartment model- state the differential equation- and solve t.docx
Draw a compartment model- state the differential equation- and solve t.docxDraw a compartment model- state the differential equation- and solve t.docx
Draw a compartment model- state the differential equation- and solve t.docx
 
Drag and drop the best description for the segments of the map indicat.docx
Drag and drop the best description for the segments of the map indicat.docxDrag and drop the best description for the segments of the map indicat.docx
Drag and drop the best description for the segments of the map indicat.docx
 
Drag the items below into the appropriate purple box Discontinuation o.docx
Drag the items below into the appropriate purple box Discontinuation o.docxDrag the items below into the appropriate purple box Discontinuation o.docx
Drag the items below into the appropriate purple box Discontinuation o.docx
 
Dr- Amanda Favata opened a medical practice specialzing in physical th.docx
Dr- Amanda Favata opened a medical practice specialzing in physical th.docxDr- Amanda Favata opened a medical practice specialzing in physical th.docx
Dr- Amanda Favata opened a medical practice specialzing in physical th.docx
 

Dernier

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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
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
QucHHunhnh
 

Dernier (20)

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...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
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"
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
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
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

Develop a Java application (ArrayMethods java) that reads 12 integers.docx

  • 1. Develop a Java application (ArrayMethods java) that reads 12 integers into an array. The application should call five static methods (from the main method) that in turn: (1) display all the integers, (2) display all the integers in reverse order, (3) display the sum of the integers, (4) display all values less than a limiting argument, and (5) display all values that are higher than the calculated average value. import java.util.Scanner; public class ArrayMethods{ public static void main(String[] args) final int L ENGT H = 10 ; int limit = 5 ; int[] intArray = new int[LENGTH]; Scanner scan = new Scanner ( System.in); System.out.print("Enter 10 integers: "); for(int i = 0 ; i < LENGTH; i + + )} intArray[i] = scan.nextint(); ) ) ) ) private static int displaySum(int[] intArr){ } private static void displayAllLessThan(int[] intArr, int lim){ } private static void displayAverage(int[] intArr){ } private static void displayAllHigherThanAverage(int[] intArr){ } }