Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  

java 2d arrays



Share on Google+Share on Google+

denzel denis
java 2d arrays
0 Answer(s)      6 years and a month ago
Posted in : Java Beginners

Create a program that will: a) Create the array and populate it with the given values.

 9, 8
 2, 17
 49, 4
 13, 119
 2, 19
 11, 47
 3, 73

b) Multiply, for each row, the value of the first column by the value of the second column, and create a grand sum of these products. c) Print out the grand sum obtained in c)

so far this is my code and it is giving me 216. and if i do it manualy it is wrong.

public class Arrays { public static void main(String[] args) { int array_x[][]={ {9,8}, {2,17},


{ int sum=0; int multiply=0;

for (int x=0; x<=6; x++){ multiply = arrayx[x][0]*arrayx[x][1]; //} sum = sum+multiply; } System.out.println(multiply); }

} }

View Answers

Related Tutorials/Questions & Answers:
java 2d arrays
java 2d arrays  Create a program that will: a) Create the array and populate it with the given values. 9, 8 2, 17 49, 4 13, 119 2, 19 11, 47.... and if i do it manualy it is wrong. public class Arrays { public static void main
2d arrays
2d arrays  what is the code for multiplying the values in a 2d array and printing out their sum
Concatenate 2D arrays
Concatenate 2D arrays  JFileChooser jf = new JFileChooser(); jf.setMultiSelectionEnabled(true); int returnVal = jf.showOpenDialog(frame); File...://
Java 2D
Java 2D  Hi, What is Java 2D? Thanks   Hi, Please see it at Java 2D API. Thanks
Arrays in java
Arrays in java  what is param array in java
java 2d graphics - Java Beginners
java 2d graphics  Hello All I need to use 2d graphics in java to build up a map from the given geographic coordinates. What i am not getting is how to scale down these geographic coordinates to device coordinates. I would
Java 2D Graphics - Applet
Java 2D Graphics  I am working on GIS project.I want represent a line in different forms like railroad, airplane etc. How can i acheive this I know...:// Here you will get lot
java arrays
java arrays  can i know how can we intilize the three dimentional arrays in java? and how can we assign thae values to that array
java arrays
java arrays  i need a java program to store student details like id,name,addr,marks,average,total..using arrays..input data using scanner class and by using class, object and constructor
Java with Arrays
Java with Arrays  I was given the assignment to create two parallel arrays; both of size 50 (declares 50 as a constant) One is an array of strings... and store it in the arrays. The input for the problem should be provided in a text
java arrays
java arrays  how do you write the code for multipliying 2 double arrays to be in a 3rd double array? here is my code: package employeepay; /** * * @author Owner */ public class Main { /** * @param args the command line
java; arrays - Java Beginners
java arrays example  How can you create a program, by using arrays and the output would be X. by using char or string.Thank you
Java Arrays
Java Arrays  import java.util.ArrayList; public class try3{ public static void reduce(int[]arr, int len){ for (int i= 0; i<len;i++) { arr[i]--; } len--; } public static void main (String[]args){ int
java arrays
java arrays  Suppose that you are required to store information about students for the module Data structures and Algorithms. The information for each student consists of the student√Ę‚?¨‚?Ęs ID number, surname, other names
Java 2D API
Java 2D API       Programming has become more interactive with Java 2D API. You can add images... since Swing is built on 2D package. Pluggable Look and Feel  The Java Swing
Arrays in java 7
This tutorial describes the concept of Arrays in java 7
arrays in java - Java Beginners
arrays in java  Hi All, I have two arrays. in this two array some name are same. I want to merge those arrays into single. But while merging I want to delete duplicate entries. How merge those arrays. Thanks, mln15584
How to concatenate two arrays in Java?
How to concatenate two arrays in Java?  How to concatenate two arrays in Java
intersection of two java arrays
intersection of two java arrays  I am trying to figure out how to compare two arrays and get the intersection and put this into a third array of the correct size. I know how to copy the two arrays into the third array but am
Arrays in java
Arrays in java Arrays are the data structure of java , we use array where we need contiguous memory allocation. Array stores same type of data structure... an array of length 5.  For more details click here : Java Array Tutorial
Java Arrays Tutorials
(). Browse the following code to Learn Java Arrays in detail...The java.util.Arrays class helps the programmers to manipulating the arrays. It provides the methods to easily manipulate the arrays. Methods provided
Introduction to java arrays
Introduction to java arrays   ... of Arrays in Java Programming language. You will learn how the Array class... arrays. To meet this feature java has provided an Array class which abstracts
reverse arrays in java
reverse arrays in java  how do i make a code that can be used to reverse the elements of an array in two dimension such that the last element of an array becomes the first element of the array and the first element of an array
reverse arrays in java
reverse arrays in java  how do i write a program in array of size n*m where both n and m are greater than 20 such that the 1st element of an array becomes the last and vice verse
Arrays - Java Interview Questions
a program that take arrays A & B as input and find missing element in B array
Iterating java arrays
Iterating java Arrays arrays can be iterated by the for, for each loop. array elements can be added to the list and then it can be iterated by the iterator() method. Example 1 public†class
arrays help - Java Beginners
arrays help  Write a program that sorts values. ? The program includes readIntegers() that o reads the user inputs o stores them in an array, and o returns the array   ? The program includes easySort() that o sorts
arrays - Java Interview Questions
a program that take arrays A & B as input and find missing element in B array
Arrays - Java Beginners
Arrays  I have created a multidimensional array(ten by ten number square) using java and I would like to separate the coumns using the pipe symbol...://
arrays - Java Beginners
]; int num; Write Java statements that do the following: a. Call the method... components of the type int.What is stored in list after the following Java code
Java Method with arrays
Java Method with arrays  My assignment is to write a java method, smallestIndex, that takes as its parameters an int array and its size, and returns the index of the (first occurrence of the) smallest element in the array. Also