473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Questions about arrays

Expand|Select|Wrap|Line Numbers
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class ArrayNo9 {
  5.  
  6.  static Scanner console = new Scanner(System.in);
  7.     public static void main(String[]args) {
  8.  
  9.      int[][] inStock = new int[10][4];
  10.      //inStock[0] = new int[10];
  11.      int[] alpha = new int[20];
  12.      int[] beta = new int[20];
  13.      int[] gamma = {11,13,15,17};
  14.      int[] delta = {3,5,2,6,10,9,7,11,1,8};
  15. copyGama(inStock,gamma);
Sep 11 '08 #1
13 1270
Ganon11
3,652 Expert 2GB
Your thread title is "Questions about arrays", but there are no questions here.
Sep 11 '08 #2
Expand|Select|Wrap|Line Numbers
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class ArrayNo9 {
  5.  
  6.  static Scanner console = new Scanner(System.in);
  7.     public static void main(String[]args) {
  8.  
  9.      int[][] inStock = new int[10][4];
  10.      int[] alpha = new int[20];
  11.      int[] beta = new int[20];
  12.      int[] gamma = {11,13,15,17};
  13.      int[] delta = {3,5,2,6,10,9,7,11,1,8};
  14.  
  15.      copyGama(inStock,gamma);
  16. }
  17. public static void copyGama(int[][]a,int[]b)
  18.     {
  19.      int index,c,i,answer;
  20.      System.out.print("\nCopy Gama\n");
  21.      for(i = 0;i<a.length;i++) // upto 10 rows
  22.      {
  23.      for(c = 0;c<b.length;c++)
  24.      {
  25.          a[i][c] = b[c];
  26.          System.out.print(" "+a[i][c]);
  27.      }
  28.      if(c==4){
  29.      System.out.println();  // every 4th element must be printed to another line
  30.      }
  31.     }
  32.     }
  33. }
  34.  
how can i make each row of the array multiplied by 3?
example the 1st row is = 11,13,15,17
2nd row is = 33, 39,45 51
3rd row is = 99, 117 , 135, 153
and so on and so forth...this is upto 10th row..you can see it on my code..
i already tried my best..but got know idea at all..
Sep 11 '08 #3
Nepomuk
3,112 Expert 2GB
Dear jimgym1989, when Ganon11 said
there are no questions here.
he didn't mean: Post a completely new thread with the question.

You should have just added your question in a reply (using the post reply button at the bottom of each thread).

I have merged your two threads, to make sure the answers go to the right place.
how can i make each row of the array multiplied by 3? [...]
you can see it on my code..
i already tried my best..but got know idea at all..
Where have you tried multiplying by with 3? I can't see it anywhere in your code.

By the way, when your code reaches line 28, c will always be the same, as it's reset to 0 at the beginning of the nested for loop and it doesn't reach line 28 until the loop is ended.

Greetings,
Nepomuk (Moderator)
Sep 11 '08 #4
Your thread title is "Questions about arrays", but there are no questions here.
just understand the code...
Sep 11 '08 #5
JosAH
11,448 Expert 8TB
just understand the code...
That is not the way to ask questions; help us to help you because most of us are
not mind readers. If you are, read my thoughts.

kind regards,

Jos (moderator)

ps. Read the 'help' link near the top of this page.
Sep 11 '08 #6
That is not the way to ask questions; help us to help you because most of us are
not mind readers. If you are, read my thoughts.

kind regards,

Jos (moderator)

ps. Read the 'help' link near the top of this page.
we are all mature so better use your common sense!!
take care...
Sep 11 '08 #7
Expand|Select|Wrap|Line Numbers
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class ArrayNo9 {
  5.  
  6.  static Scanner console = new Scanner(System.in);
  7.     public static void main(String[]args) {
  8.  
  9.      int[][] inStock = new int[10][4];
  10.      int[] alpha = new int[20];
  11.      int[] beta = new int[20];
  12.      int[] gamma = {11,13,15,17};
  13.      int[] delta = {3,5,2,6,10,9,7,11,1,8};
  14.  
  15.      copyGama(inStock,gamma);
  16. }
  17. public static void copyGama(int[][]a,int[]b)
  18.     {
  19.      int index,c,i,answer;
  20.      System.out.print("\nCopy Gama\n");
  21.      for(i = 0;i<a.length;i++) // upto 10 rows
  22.      {
  23.      for(c = 0;c<b.length;c++)
  24.      {
  25.          a[i][c] = b[c];
  26.          System.out.print(" "+a[i][c]);
  27.      }
  28.      if(c==4){
  29.      System.out.println();  // every 4th element must be printed to another line
  30.      }
  31.     }
  32.     }
  33. }
  34.  
how can i make each row of the array multiplied by 3?
example the 1st row is = 11,13,15,17
2nd row is = 33, 39,45 51
3rd row is = 99, 117 , 135, 153
and so on and so forth...this is upto 10th row..you can see it on my code..
i already tried my best..but got know idea at all..
that was my question
Sep 11 '08 #8
Nepomuk
3,112 Expert 2GB
that was my question
...which I had to move here. Listen, from just posting a bit of code (which was all that was here when Ganon11 asked), nobody can guess that you want to multiply lines by three. You may want to add things up or swap the values or anything else.

Now, as Jos said, we can't read your mind. We are happy to help you, but we're doing this for free and because we're all nice people. So if someone doesn't understand your question, try to put it in other words.

In case you haven't done so already, please read the Posting Guidelines, especially the Sections about How to ask a question and Things that are generally unacceptable. Saying things like
just understand the code...
or
we are all mature so better use your common sense!!
imply that you are accusing us of being dumb or immature. I would call that a breach of the rule
Personal Insults or Attacks
and am hereby giving you an official warning (your second one by the way). Keep to the rules from now on and we'll solve your problem with you. Continue like this however and it will have consequences.

Greetings,
Nepomuk (Moderator)
Sep 11 '08 #9
...which I had to move here. Listen, from just posting a bit of code (which was all that was here when Ganon11 asked), nobody can guess that you want to multiply lines by three. You may want to add things up or swap the values or anything else.

Now, as Jos said, we can't read your mind. We are happy to help you, but we're doing this for free and because we're all nice people. So if someone doesn't understand your question, try to put it in other words.

In case you haven't done so already, please read the Posting Guidelines, especially the Sections about How to ask a question and Things that are generally unacceptable.
Saying things like or imply that you are accusing us of being dumb or immature
.
I would call that a breach of the rule and am hereby giving you an official warning (your second one by the way).
Keep to the rules from now on and we'll solve your problem with you. Continue like this however and it will have consequences.

Greetings,
Nepomuk (Moderator)
ok!! sorry!! it depends on what your thinking!!
but no offense!!
:-)
When was the first warning master? i can't remember it.. sorry..
please forgive me..all you say was not my intention..but ok! there is nothing I can't do about that because your the Administrator..Sorry!!
Sep 12 '08 #10
NeoPa
32,556 Expert Mod 16PB
ok!! sorry!! it depends on what your thinking!!
but no offense!!
:-)
...
A more reliable way of not causing offense, is not to say the offensive thing in the first place.
...
When was the first warning master? i can't remember it.. sorry..
...
While there was no official warning given before, you have previously been called to attention on not following the site rules (See post #2 of I Have A Class And Method Problems....). It surprises me not at all that you wouldn't remember. You don't seem to have the capacity to pay any attention to what you're being told, your focus concentrating so exclusivley on yourself.
...
please forgive me..all you say was not my intention..but ok! there is nothing I can't do about that because your the Administrator..Sorry!!
If it was not your intention to commit the offenses, then I should advise you to get a bit more control of yourself. I can't see who should be responsible for this if not yourself.

As for the administrator jibe. Nepomuck is a moderator, so I assume he treats this comment with the derision it deserves.
I however, AM an administrator, and I can confirm that none of us intends to put up with any more of your petulant outbursts. To put this in the plainest English I can, "Either desist or your account will be suspended. Further infringements after that will result in a permanent ban on your account."
Sep 12 '08 #11
Nepomuk
3,112 Expert 2GB
When was the first warning master? i can't remember it.. sorry..
As NeoPa pointed out, I called you to attention in your I Have A Class And Method Problems.... thread. I do admit however, that it wasn't clearly an official warning, so sorry for not being clear earlier.
please forgive me..all you say was not my intention..but ok!
I can't speak for the others, but I'm not resentful and if you behave respectfully and keep to the rules from now on, everything will be fine. If you don't however... well, just read NeoPa's reply.

Now, back to your question: Please note what I said in reply #4:
Where have you tried multiplying by with 3? I can't see it anywhere in your code.

By the way, when your code reaches line 28, c will always be the same, as it's reset to 0 at the beginning of the nested for loop and it doesn't reach line 28 until the loop is ended.
I assume you have a third function to do that job? Can we please see it? If you don't have it yet, can you try to write it and, if you have problems, show us that? Because we're not going to write it for you.

Greetings,
Nepomuk
Sep 12 '08 #12
by the way..I already solved the problem!
tnx for your effort..
:)
Sep 13 '08 #13
Nepomuk
3,112 Expert 2GB
by the way..I already solved the problem!
tnx for your effort..
:)
That's good. If you need any further help (with this or any other task), feel free to ask - but please keep to the site rules.

Greetings,
Nepomuk
Sep 15 '08 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: bearophile | last post by:
Hello, I have few more things to say/ask (left from a discussion in another Python Newsgroup). Is it possibile (and useful) to write few small sub-sections of the Python interpreter in Assembly...
2
by: Ross Micheals | last post by:
All I have some general .NET questions that I'm looking for some help with. Some of these questions (like the first) are ones that I've seen various conflicting information on, or questions that...
4
by: k-man | last post by:
Hi! I'll try to make it short: 1) is memset() optimised is some way (I suppose at various level depending of implementations) and if so, to what level? Is it faster to memset() 4kbytes of...
5
by: jeremy.d.brewer | last post by:
Hi, I'm rather new to Python, and I've just written my first Python C module. I was wondering if some more experience Pythonista would look over what I've written and given me some pointers (or...
50
by: Jatinder | last post by:
I 'm a professional looking for the job.In interview these questions were asked with some others which I answered.But some of them left unanswered.Plz help. Here are some questions on C/C++, OS...
7
by: Victor S. | last post by:
1. What is System.Windows.Forms.VisualStyles.TextMetricsCharacterSet good for? 2. Are the Indic scripts supported? Are all supported scripts fully supported? (for printing and fine measuring)...
11
by: efrat | last post by:
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure...
12
by: Gilbert | last post by:
H, i'm starting with asp.net/vb.net and have some questions about arrays and collections: 1) what's the difference between: dim x() as string and dim x as array
4
by: Jess | last post by:
Hello, I tried several books to find out the details of object initialization. Unfortunately, I'm still confused by two specific concepts, namely default-initialization and...
110
by: fjm | last post by:
For some reason, I have always had a hard time understanding arrays as they pertain to php and databases. I understand associative arrays just fine but when there are multidimensional arrays, I kinda...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.