SlideShare a Scribd company logo
1 of 3
Download to read offline
class Array
{
public static int getTotal(int[][]numbers )
{
int tot=0;
// Lo0op repeats until list ends
for (int row = 0;row < numbers .legth; row++)
for (int col=0 ;col< numbers [row].length; col++)
tot+=numbers [row][col];
return tot;
}
// return avarage
public static double getAvarage(int [][]numbers,int index)
{
double avg;
avg=(double) (getTotal(numbers/(12));
return avg;
}
public static int getRowTotal (int [][] numbers, int index)
{
int tot=0;
// loop repeats until list ends
for (int col=0;col<4;col++)
// Accumulates sum of numbers
tot+= number[index][col];
return tot;
}
public static int getHighest(int [][] numbers, int row)
{
int high= numbers [row][0];
// Loop repeats until list ends
for (int i = 1; i<4; i++)
if (numbers[rows][i]>high )
high = numbers [row] [i];
return high;
}
public static int getLowest (int [][]number,int row)
{
int low = number [row][0];
// Loop repeats until list ends
for(inti = 1 ;i < 4 ;i++)
if (numbers [row][i]
Solution
class ArrayDemo {
// main function
public static void main(String[] arg) {
int[][] list = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 } };
// Function call and display data returned
System.out.println("total:" + getTotal(list));
System.out.println("Average:" + getAverage(list));
System.out.println("Row 2 value:" + getRowTotal(list, 2));
System.out.println("column3 value:" + getColumnTotal(list, 3));
System.out.println("highest value in row 1 is:" + getHighest(list, 1));
System.out.println("lowest value in row 2 is:" + getLowest(list, 2));
// exit program
System.exit(0);
}
public static int getTotal(int[][] numbers) {
int tot = 0;
// Lo0op repeats until list ends
for (int row = 0; row < numbers.length; row++)
for (int col = 0; col < numbers[row].length; col++)
tot += numbers[row][col];
return tot;
}
// return average
public static double getAverage(int [][]numbers)
{
double avg;
avg=(double) getTotal(numbers)/12;
return avg;
}
public static int getRowTotal(int[][] numbers, int index) {
int tot = 0;
// loop repeats until list ends
for (int col = 0; col < 4; col++)
// Accumulates sum of numbers
tot += numbers[index][col];
return tot;
}
public static int getHighest(int[][] numbers, int row) {
int high = numbers[row][0];
// Loop repeats until list ends
for (int i = 1; i < 4; i++)
if (numbers[row][i] > high)
high = numbers[row][i];
return high;
}
public static int getLowest(int[][] numbers, int row) {
int low = numbers[row][0];
// Loop repeats until list ends
for (int i = 1; i < 4; i++)
if (numbers[row][i] < low)
low = numbers[row][i];
return low;
}
public static int getColumnTotal(int[][] numbers, int column) {
int sum = 0;
for(int i = 0; i < numbers.length; i++)
sum += numbers[i][column];
return sum;
}
}

More Related Content

Similar to class Array { public static int getTotal(int[][]numbers ) { .pdf

public static ArrayListInteger doArrayListInsertAtMedian(int nu.pdf
public static ArrayListInteger doArrayListInsertAtMedian(int nu.pdfpublic static ArrayListInteger doArrayListInsertAtMedian(int nu.pdf
public static ArrayListInteger doArrayListInsertAtMedian(int nu.pdfarihanthtoysandgifts
 
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdfJAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdfarpaqindia
 
I need help with the 2nd TODO comment and the other comments Ill.pdf
I need help with the 2nd TODO comment and the other comments Ill.pdfI need help with the 2nd TODO comment and the other comments Ill.pdf
I need help with the 2nd TODO comment and the other comments Ill.pdfEye2eyeopticians10
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdffeelinggift
 
An object of class StatCalc can be used to compute several simp.pdf
 An object of class StatCalc can be used to compute several simp.pdf An object of class StatCalc can be used to compute several simp.pdf
An object of class StatCalc can be used to compute several simp.pdfaravlitraders2012
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfankit11134
 
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
 
No excuses, switch to kotlin
No excuses, switch to kotlinNo excuses, switch to kotlin
No excuses, switch to kotlinThijs Suijten
 
The java language cheat sheet
The java language cheat sheetThe java language cheat sheet
The java language cheat sheetanand_study
 
Rewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdfRewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdfalphaagenciesindia
 
I need to fill-in TODOs in .cpp file and in .h file Could some.pdf
I need to fill-in TODOs in .cpp file and in .h file Could some.pdfI need to fill-in TODOs in .cpp file and in .h file Could some.pdf
I need to fill-in TODOs in .cpp file and in .h file Could some.pdfforladies
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Andrey Akinshin
 
import java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdfimport java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdfaquastore223
 
( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdf
( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdf( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdf
( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdfaristogifts99
 
import javautilQueue import javautilLinkedList import .pdf
import javautilQueue import javautilLinkedList import .pdfimport javautilQueue import javautilLinkedList import .pdf
import javautilQueue import javautilLinkedList import .pdfADITIEYEWEAR
 
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...tdc-globalcode
 
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
 

Similar to class Array { public static int getTotal(int[][]numbers ) { .pdf (20)

public static ArrayListInteger doArrayListInsertAtMedian(int nu.pdf
public static ArrayListInteger doArrayListInsertAtMedian(int nu.pdfpublic static ArrayListInteger doArrayListInsertAtMedian(int nu.pdf
public static ArrayListInteger doArrayListInsertAtMedian(int nu.pdf
 
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdfJAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
 
I need help with the 2nd TODO comment and the other comments Ill.pdf
I need help with the 2nd TODO comment and the other comments Ill.pdfI need help with the 2nd TODO comment and the other comments Ill.pdf
I need help with the 2nd TODO comment and the other comments Ill.pdf
 
Huraira_waris_Assgnment_4.docx
Huraira_waris_Assgnment_4.docxHuraira_waris_Assgnment_4.docx
Huraira_waris_Assgnment_4.docx
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdf
 
An object of class StatCalc can be used to compute several simp.pdf
 An object of class StatCalc can be used to compute several simp.pdf An object of class StatCalc can be used to compute several simp.pdf
An object of class StatCalc can be used to compute several simp.pdf
 
PathOfMostResistance
PathOfMostResistancePathOfMostResistance
PathOfMostResistance
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.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
 
No excuses, switch to kotlin
No excuses, switch to kotlinNo excuses, switch to kotlin
No excuses, switch to kotlin
 
The java language cheat sheet
The java language cheat sheetThe java language cheat sheet
The java language cheat sheet
 
Rewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdfRewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdf
 
I need to fill-in TODOs in .cpp file and in .h file Could some.pdf
I need to fill-in TODOs in .cpp file and in .h file Could some.pdfI need to fill-in TODOs in .cpp file and in .h file Could some.pdf
I need to fill-in TODOs in .cpp file and in .h file Could some.pdf
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?
 
import java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdfimport java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdf
 
( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdf
( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdf( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdf
( PLEASE SHOW HOW TO IMPLEMENT THE DELETION FUNCTION )SAMPLE OUTPU.pdf
 
import javautilQueue import javautilLinkedList import .pdf
import javautilQueue import javautilLinkedList import .pdfimport javautilQueue import javautilLinkedList import .pdf
import javautilQueue import javautilLinkedList import .pdf
 
Java cheatsheet
Java cheatsheetJava cheatsheet
Java cheatsheet
 
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
 
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
 

More from trishacolsyn25353

Functionally important traits in animals tend to vary little from on.pdf
Functionally important traits in animals tend to vary little from on.pdfFunctionally important traits in animals tend to vary little from on.pdf
Functionally important traits in animals tend to vary little from on.pdftrishacolsyn25353
 
Find the values of the trigonometric functions of t from the given in.pdf
Find the values of the trigonometric functions of t from the given in.pdfFind the values of the trigonometric functions of t from the given in.pdf
Find the values of the trigonometric functions of t from the given in.pdftrishacolsyn25353
 
Explain how the skeletal system is more than just bonesbone tissue..pdf
Explain how the skeletal system is more than just bonesbone tissue..pdfExplain how the skeletal system is more than just bonesbone tissue..pdf
Explain how the skeletal system is more than just bonesbone tissue..pdftrishacolsyn25353
 
Digitization introduces quantization errors that cannot be removed b.pdf
Digitization introduces quantization errors that cannot be removed b.pdfDigitization introduces quantization errors that cannot be removed b.pdf
Digitization introduces quantization errors that cannot be removed b.pdftrishacolsyn25353
 
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdfDesign, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdftrishacolsyn25353
 
Describe how caregivers can promote maximum independence among peopl.pdf
Describe how caregivers can promote maximum independence among peopl.pdfDescribe how caregivers can promote maximum independence among peopl.pdf
Describe how caregivers can promote maximum independence among peopl.pdftrishacolsyn25353
 
An Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdf
An Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdfAn Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdf
An Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdftrishacolsyn25353
 
A uniform plane wave propagates in the y direction in air with its el.pdf
A uniform plane wave propagates in the y direction in air with its el.pdfA uniform plane wave propagates in the y direction in air with its el.pdf
A uniform plane wave propagates in the y direction in air with its el.pdftrishacolsyn25353
 
A student wanted to look at germination of five different seeds in ve.pdf
A student wanted to look at germination of five different seeds in ve.pdfA student wanted to look at germination of five different seeds in ve.pdf
A student wanted to look at germination of five different seeds in ve.pdftrishacolsyn25353
 
A laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdf
A laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdfA laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdf
A laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdftrishacolsyn25353
 
5) look up the following health-based peer-reviewed journal article .pdf
5) look up the following health-based peer-reviewed journal article .pdf5) look up the following health-based peer-reviewed journal article .pdf
5) look up the following health-based peer-reviewed journal article .pdftrishacolsyn25353
 
Click the icon to view ne able of de More Info Fluid Density Height o.pdf
Click the icon to view ne able of de More Info Fluid Density Height o.pdfClick the icon to view ne able of de More Info Fluid Density Height o.pdf
Click the icon to view ne able of de More Info Fluid Density Height o.pdftrishacolsyn25353
 
Write sinusoidal mathematical equations in MATLAB to play your favor.pdf
Write sinusoidal mathematical equations in MATLAB to play your favor.pdfWrite sinusoidal mathematical equations in MATLAB to play your favor.pdf
Write sinusoidal mathematical equations in MATLAB to play your favor.pdftrishacolsyn25353
 
Write 300-400 words review of the paper using your own words and n.pdf
Write 300-400 words review of the paper using your own words and n.pdfWrite 300-400 words review of the paper using your own words and n.pdf
Write 300-400 words review of the paper using your own words and n.pdftrishacolsyn25353
 
will left-wing terror increase, remain the same, or decrease in the .pdf
will left-wing terror increase, remain the same, or decrease in the .pdfwill left-wing terror increase, remain the same, or decrease in the .pdf
will left-wing terror increase, remain the same, or decrease in the .pdftrishacolsyn25353
 
Which Boolean algebra theorem describes the situation where any varia.pdf
Which Boolean algebra theorem describes the situation where any varia.pdfWhich Boolean algebra theorem describes the situation where any varia.pdf
Which Boolean algebra theorem describes the situation where any varia.pdftrishacolsyn25353
 
What is the time difference in myelinated vs. unmyelinated axons.pdf
What is the time difference in myelinated vs. unmyelinated axons.pdfWhat is the time difference in myelinated vs. unmyelinated axons.pdf
What is the time difference in myelinated vs. unmyelinated axons.pdftrishacolsyn25353
 
whats is the hostory of mathematicsSolutionIt deals with the .pdf
whats is the hostory of mathematicsSolutionIt deals with the .pdfwhats is the hostory of mathematicsSolutionIt deals with the .pdf
whats is the hostory of mathematicsSolutionIt deals with the .pdftrishacolsyn25353
 
what is spiled identity as in disabilityAre all aspects of spoile.pdf
what is spiled identity as in disabilityAre all aspects of spoile.pdfwhat is spiled identity as in disabilityAre all aspects of spoile.pdf
what is spiled identity as in disabilityAre all aspects of spoile.pdftrishacolsyn25353
 
Wendy and Peter want to buy property together.  Wendy will be contri.pdf
Wendy and Peter want to buy property together.  Wendy will be contri.pdfWendy and Peter want to buy property together.  Wendy will be contri.pdf
Wendy and Peter want to buy property together.  Wendy will be contri.pdftrishacolsyn25353
 

More from trishacolsyn25353 (20)

Functionally important traits in animals tend to vary little from on.pdf
Functionally important traits in animals tend to vary little from on.pdfFunctionally important traits in animals tend to vary little from on.pdf
Functionally important traits in animals tend to vary little from on.pdf
 
Find the values of the trigonometric functions of t from the given in.pdf
Find the values of the trigonometric functions of t from the given in.pdfFind the values of the trigonometric functions of t from the given in.pdf
Find the values of the trigonometric functions of t from the given in.pdf
 
Explain how the skeletal system is more than just bonesbone tissue..pdf
Explain how the skeletal system is more than just bonesbone tissue..pdfExplain how the skeletal system is more than just bonesbone tissue..pdf
Explain how the skeletal system is more than just bonesbone tissue..pdf
 
Digitization introduces quantization errors that cannot be removed b.pdf
Digitization introduces quantization errors that cannot be removed b.pdfDigitization introduces quantization errors that cannot be removed b.pdf
Digitization introduces quantization errors that cannot be removed b.pdf
 
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdfDesign, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
 
Describe how caregivers can promote maximum independence among peopl.pdf
Describe how caregivers can promote maximum independence among peopl.pdfDescribe how caregivers can promote maximum independence among peopl.pdf
Describe how caregivers can promote maximum independence among peopl.pdf
 
An Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdf
An Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdfAn Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdf
An Hfr strain that is met+pro+bio+his+ was mated with an F- strain t.pdf
 
A uniform plane wave propagates in the y direction in air with its el.pdf
A uniform plane wave propagates in the y direction in air with its el.pdfA uniform plane wave propagates in the y direction in air with its el.pdf
A uniform plane wave propagates in the y direction in air with its el.pdf
 
A student wanted to look at germination of five different seeds in ve.pdf
A student wanted to look at germination of five different seeds in ve.pdfA student wanted to look at germination of five different seeds in ve.pdf
A student wanted to look at germination of five different seeds in ve.pdf
 
A laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdf
A laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdfA laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdf
A laboratory technician mixes 1 mL of a stock culture with 99 mL of .pdf
 
5) look up the following health-based peer-reviewed journal article .pdf
5) look up the following health-based peer-reviewed journal article .pdf5) look up the following health-based peer-reviewed journal article .pdf
5) look up the following health-based peer-reviewed journal article .pdf
 
Click the icon to view ne able of de More Info Fluid Density Height o.pdf
Click the icon to view ne able of de More Info Fluid Density Height o.pdfClick the icon to view ne able of de More Info Fluid Density Height o.pdf
Click the icon to view ne able of de More Info Fluid Density Height o.pdf
 
Write sinusoidal mathematical equations in MATLAB to play your favor.pdf
Write sinusoidal mathematical equations in MATLAB to play your favor.pdfWrite sinusoidal mathematical equations in MATLAB to play your favor.pdf
Write sinusoidal mathematical equations in MATLAB to play your favor.pdf
 
Write 300-400 words review of the paper using your own words and n.pdf
Write 300-400 words review of the paper using your own words and n.pdfWrite 300-400 words review of the paper using your own words and n.pdf
Write 300-400 words review of the paper using your own words and n.pdf
 
will left-wing terror increase, remain the same, or decrease in the .pdf
will left-wing terror increase, remain the same, or decrease in the .pdfwill left-wing terror increase, remain the same, or decrease in the .pdf
will left-wing terror increase, remain the same, or decrease in the .pdf
 
Which Boolean algebra theorem describes the situation where any varia.pdf
Which Boolean algebra theorem describes the situation where any varia.pdfWhich Boolean algebra theorem describes the situation where any varia.pdf
Which Boolean algebra theorem describes the situation where any varia.pdf
 
What is the time difference in myelinated vs. unmyelinated axons.pdf
What is the time difference in myelinated vs. unmyelinated axons.pdfWhat is the time difference in myelinated vs. unmyelinated axons.pdf
What is the time difference in myelinated vs. unmyelinated axons.pdf
 
whats is the hostory of mathematicsSolutionIt deals with the .pdf
whats is the hostory of mathematicsSolutionIt deals with the .pdfwhats is the hostory of mathematicsSolutionIt deals with the .pdf
whats is the hostory of mathematicsSolutionIt deals with the .pdf
 
what is spiled identity as in disabilityAre all aspects of spoile.pdf
what is spiled identity as in disabilityAre all aspects of spoile.pdfwhat is spiled identity as in disabilityAre all aspects of spoile.pdf
what is spiled identity as in disabilityAre all aspects of spoile.pdf
 
Wendy and Peter want to buy property together.  Wendy will be contri.pdf
Wendy and Peter want to buy property together.  Wendy will be contri.pdfWendy and Peter want to buy property together.  Wendy will be contri.pdf
Wendy and Peter want to buy property together.  Wendy will be contri.pdf
 

Recently uploaded

Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 

Recently uploaded (20)

Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 

class Array { public static int getTotal(int[][]numbers ) { .pdf

  • 1. class Array { public static int getTotal(int[][]numbers ) { int tot=0; // Lo0op repeats until list ends for (int row = 0;row < numbers .legth; row++) for (int col=0 ;col< numbers [row].length; col++) tot+=numbers [row][col]; return tot; } // return avarage public static double getAvarage(int [][]numbers,int index) { double avg; avg=(double) (getTotal(numbers/(12)); return avg; } public static int getRowTotal (int [][] numbers, int index) { int tot=0; // loop repeats until list ends for (int col=0;col<4;col++) // Accumulates sum of numbers tot+= number[index][col]; return tot; } public static int getHighest(int [][] numbers, int row) { int high= numbers [row][0]; // Loop repeats until list ends for (int i = 1; i<4; i++) if (numbers[rows][i]>high ) high = numbers [row] [i]; return high;
  • 2. } public static int getLowest (int [][]number,int row) { int low = number [row][0]; // Loop repeats until list ends for(inti = 1 ;i < 4 ;i++) if (numbers [row][i] Solution class ArrayDemo { // main function public static void main(String[] arg) { int[][] list = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 } }; // Function call and display data returned System.out.println("total:" + getTotal(list)); System.out.println("Average:" + getAverage(list)); System.out.println("Row 2 value:" + getRowTotal(list, 2)); System.out.println("column3 value:" + getColumnTotal(list, 3)); System.out.println("highest value in row 1 is:" + getHighest(list, 1)); System.out.println("lowest value in row 2 is:" + getLowest(list, 2)); // exit program System.exit(0); } public static int getTotal(int[][] numbers) { int tot = 0; // Lo0op repeats until list ends for (int row = 0; row < numbers.length; row++) for (int col = 0; col < numbers[row].length; col++) tot += numbers[row][col]; return tot; } // return average public static double getAverage(int [][]numbers) { double avg; avg=(double) getTotal(numbers)/12;
  • 3. return avg; } public static int getRowTotal(int[][] numbers, int index) { int tot = 0; // loop repeats until list ends for (int col = 0; col < 4; col++) // Accumulates sum of numbers tot += numbers[index][col]; return tot; } public static int getHighest(int[][] numbers, int row) { int high = numbers[row][0]; // Loop repeats until list ends for (int i = 1; i < 4; i++) if (numbers[row][i] > high) high = numbers[row][i]; return high; } public static int getLowest(int[][] numbers, int row) { int low = numbers[row][0]; // Loop repeats until list ends for (int i = 1; i < 4; i++) if (numbers[row][i] < low) low = numbers[row][i]; return low; } public static int getColumnTotal(int[][] numbers, int column) { int sum = 0; for(int i = 0; i < numbers.length; i++) sum += numbers[i][column]; return sum; } }