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
The use of themes in WordPress is a good illustration of what major concept?
NemiM [27]

Answer:

Front-End Development

Explanation:

This is what the consumer will see and interact with such as the theme.

8 0
3 years ago
Write a function called show_info that takes a name, a home city, and a home state (a total of 3 arguments) and returns a full s
Delicious77 [7]

Answer:

Below are the function for the above question in java Language---

void show_info(String name,String home,String state)

    {

        System.out.println("Your name is "+name+" and you live in "+ home+" ,"+state +".");

    }

Output:

  • If the user inputs name="Gaus",city="LosAngeles" and state="California" then the output will be "Your name is Gaus and you live in LosAngeless, California."

Explanation:

  • The above function is in java language which takes three argument names, state, and the city.
  • The name will be stored on the name variable of the string type.
  • The state will be stored on the state variable of string type.
  • The city will be stored on the city variable of the string type.
  • Then the Output will be displayed with the help of the print function.
  • '+' is used to merge the string.
5 0
3 years ago
Yesterday Hunter's laptop screen appeared to go black. The laptop was still running, but he could not see the desktop or any gra
shepuryov [24]

Answer:

The video card needs to be replaced

Explanation:

The video card is a part of the motherboard that controls the graphic renderings of the computer. Once this is faulty, it can lead to several issues ranging from computer freezes or  computer crashes to most commonly, laptop black screens.

The most common test to see if the "black screen fault" is from the video card, is to connect the laptop to another monitor that has its own graphics rendering instrument. If it works on that monitor, Then the video card of the laptop is the problem.

Since this is the case detailed in the problem above, the video card of the laptop needs to be replaced.

3 0
3 years ago
Which statement describes how to insert the IF, COUNTIF, or SUM function into a cell?
aleksley [76]

Answer:

Type an = sign in the cell, followed by the name of the function and the relevant arguments.

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents. There are different types of functions used in Microsoft Excel to perform specific tasks and these includes;

1. VLOOKUP function: it's an Excel function that avails end users the ability to lookup data in a table organized vertically. Thus, it's typically used for searching values in a column.

2. SUMIF function: it is an Excel function to sum cells that meet criteria such as text, dates and numbers. This function can be used with the following logical operators; <, >, and =.

3. COUNT function: it's an Excel function to find the total number of entries in a column. For example, to count the number of entries in B1:B15; COUNT(B2:B15).

4. IF function: runs a logical test and returns one value for a TRUE result, and another for a FALSE result. For example, to fail scores that are below 40; IF (A1 < 40, "Fail", "Pass").

5. HLOOKUP function: it's an Excel function that avails end users the ability to lookup data in a table organized horizontally. Thus, it's typically used for searching values in a column.

In Microsoft Excel, to insert the IF, COUNTIF, or SUM function into a cell, you should type an equal to (=) sign in the cell, followed by the name of the particular function and the relevant arguments.

For example, to use the SUMIF function, you should type; =SUMIF(A2:B5, "Peter", C1:C9).

7 0
3 years ago
You recently started working part-time in a retail store, and are learning about the reading devices your store uses. Your store
sleet_krkn [62]

Answer:

QR code

Explanation:

QR Code. Short for quick response code, which can also be called 2-D bar code, a QR code is a type of two-dimensional (2D) barcode that are read with the aid of a QR barcode reader or a camera-enabled smartphone with an inbuilt or installed QR reader software.

A QR code is capable of carrying information in both the vertical and the horizontal direction, which is the reason behind the name 2D barcode.

3 0
3 years ago
Other questions:
  • For a color display using 8 bits for each of the primary colors (red, green, blue) per pixel, what should be the minimum size in
    6·1 answer
  • Header and Footer options are located in the _____ tab.
    7·1 answer
  • Using PowerPoint or Impressed guarantees that your presentation will do which of the following?
    6·1 answer
  • What are interpersonal skills?
    12·2 answers
  • Alexi is writing a program which prompts users to enter their age. Which function should she use?
    6·2 answers
  • There are....... section in<br>cpu<br>​
    15·1 answer
  • Which technology will a business use to figure out who accessed confidential files on a company's computer system
    12·1 answer
  • _____the measuring instrument is not necssery​
    10·1 answer
  • Write the Stats method record that takes a test score and records that score in the database. If the score already exists in the
    15·1 answer
  • Assessment
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!