1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
il63 [147K]
3 years ago
10

- Create a Java program in both Windows and Ubuntu using any of their Editors *** DO NOT USE IDE'S SUCH AS ECLIPSE, NETBEANS, ET

C *** - Windows : In the Command Line (cmd), use the notepad or notepad++ editor - Ubuntu : In the Terminal Mode use the gedit, or nano or pico or vi or vim editor - Compile and run this program using the MSDOS/Terminal ex: to compile : javac ArrayMath.java to run : java ArrayMath Purpose of this program: - Create a 10 x 10 two dimensional array of int data type (Remember that arrays start with 0, not 1. - Load each index in the array with the multiplication of each (row * column) location - Using printf display the content of each index, ALIGNED. - Create an algorithm using a loop that will add all the values in all odd columns, and print their total aligned below the column. - Print the addition of all values in each index in the array. This is a sum of all the elements of the array. - Print your name and Panther ID below all other output.

Computers and Technology
1 answer:
Marat540 [252]3 years ago
8 0

Answer:

Following are the code to this question:

public class ArrayMath//defining a class ArrayMath

{

public static void main(String[] args) //defining main method

{

int x[][]=new int[10][10]; //defining a 2D array  

arrays(x);//calling a method arrays by passing an array

}

private static void arrays(int[][] x)//defining a method arrays

{

int odd_column_sum=0,sum_of_Elements=0,i,j,even=1;//defining integer variable  

for(i=0;i<x.length;i++)//defining loop for columns  

{

for(j=0;j<x[0].length;j++)//defining loop for rows

{

x[i][j]=i*j;//multiply the i and j value atore in array

}

}

System.out.println("::The 2D array :: ");//print message

for(i=0;i<x.length;i++)//defining loop for columns

{

System.out.print("\t");//use print method for line space and line break  

for(j=0;j<x[0].length;j++)//defining loop for rows

{

System.out.printf("%d\t",x[i][j]); //print array values

}

System.out.println( );//print for line break

}

for(i=0;i<x.length;i++) //defining loop for Columns

{

for(j=0;j<x[0].length;j++) //defining loop for rows

{

if(even%2!=0)//defining if block for check odd number condition

{

odd_column_sum+=x[j][i];//add odd number of array

}

sum_of_Elements+=x[i][j];//add even number of array

}

even++;//increment even variable value by 1

}

System.out.println("The sum of Odd Columns:"+odd_column_sum);//print odd_column_sum value

System.out.println("The array elements :"+sum_of_Elements);//print sum_of_Elements value

}

}

Output:

please find attached file.

Explanation:

In the above-given code, a class "ArrayMath" is defined, inside the class the main method is declared, which define a 2D array "x", this stores 10 columns and 10 rows and at the last, we call the arrays method by passing an array as a variable.

In the arrays method, integer variable, "odd_column_sum, sum_of_Elements, i, j, and even" is defined, in which variable "i and j" is used in the loop for calculating value, even is used to check odd column and then store its value in the "odd_column_sum" variable, and add whole element value is added into the "sum_of_Elements" variable.

You might be interested in
How the data is converted into the information?​
leonid [27]

Answer:

the data is converted into information by data processing

7 0
3 years ago
Read 2 more answers
If you want to open an application that does not have a tile pinned to the start menu
guapka [62]
Search for it in the start menu. Once you find it, right click and press "Pin to taskbar."
6 0
3 years ago
A user deletes a message from a mailbox while on a desktop. What happens to the email message on the user's synchronized devices
gulaghasi [49]

Answer:

Explanation:

Depends on the configuration of the email because there are two protocols POP and IMAP, the most recent protocol is IMAP, we can delete an email and this It moves to a To be Deleted folder, this happens because the email is stored in the server, but with the protocol POP the email is stored in the server and downloaded to the application, if you delete an email, this is deleted in all devices.

8 0
3 years ago
Read 2 more answers
A Lost link is an interruption or loss of the control link between the control station and the unmanned aircraft, preventing con
Vlad [161]

Answer:

There is nothing to answer from this statement.

Explanation:

Can you rephrase the statement into question?

4 0
3 years ago
1.Discuss the differences and similarities between a peer-to peer network and a client server network.
irga5000 [103]

Answer:

dsdasd1.Discuss the differences and similarities between a peer-to peer network and a client server network.

1.Discuss the differences and similarities between a peer-to peer network and a client server network.

1.Discuss the differences and similarities between a peer-to peer network and a client server network.

1.Discuss the differences and similarities between a peer-to peer network and a client server network.

1.Discuss the differences and similarities between a peer-to peer network and a client server network.

1.Discuss the differences and similarities between a peer-to peer network and a client server network.

1.Discuss the differences and similarities between a peer-to peer network and a client server network.

Explanation:

jaiusfkybuetcrjnwxyefshrcxijkwuecvashcnzx

5 0
2 years ago
Other questions:
  • Which of the following is NOT a common GUI component? O a. Label b. Button c. Key press d. Text box
    12·2 answers
  • Why are prepositions, conjunctions, and pronouns usually considered poor choices to use as key words?
    5·2 answers
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    7·1 answer
  • How do you read a column
    8·1 answer
  • When is e-mail an appropriate channel for goodwill messages? If you frequently communicate with the receiver by e-mail and are c
    15·1 answer
  • One guideline for writing content for the web is to use ____ space to visually separate sections of content.
    15·1 answer
  • In class, we discussed static local variables in C. Answereach question below; if necessary, find and consult a reference on the
    10·1 answer
  • A picture of kitchen sink draining system​
    15·2 answers
  • Create the following new exceptions: PokemonException, which extends the Exception class. It must have a no-parameter constructo
    13·1 answer
  • All of the following are true about data science and big data except: a.Digital data is growing at the rate of 2.5 quintillion b
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!