Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2954 > unrolled thread

core java coding.. pls help !

Started byRiya <riyaachar01@gmail.com>
First post2014-05-14 11:07 -0700
Last post2014-06-22 10:46 -0700
Articles 4 — 4 participants

Back to article view | Back to comp.lang.java.help


Contents

  core java coding.. pls help ! Riya <riyaachar01@gmail.com> - 2014-05-14 11:07 -0700
    Re: core java coding.. pls help ! Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-14 14:32 -0400
      Re: core java coding.. pls help ! rossum <rossum48@coldmail.com> - 2014-05-15 16:44 +0100
    Re: core java coding.. pls help ! Roedy Green <see_website@mindprod.com.invalid> - 2014-06-22 10:46 -0700

#2954 — core java coding.. pls help !

FromRiya <riyaachar01@gmail.com>
Date2014-05-14 11:07 -0700
Subjectcore java coding.. pls help !
Message-ID<54e9c913-a553-4faa-be8d-9f483f4bca34@googlegroups.com>
please help me to code in java..
my project is related to cloudsim, where i am also using core java to code.
Its mainly related to virtual machines(vm) and cloudlets/tasks, so each vm
will be given a set of cloudlet and it has to execute.Now i have to find
out how much each vm will cost if i assign particular amount to each one of
them.

I want to create two array which are 2 Dimensional.
1st array should contain "vm id"(1,2,3) and its "mips"(random values viz
50,100,150).
2nd array must have mips from 1st array and it should hold cost ( random
value say 500, 1000, 1500).

Thank you.
pls reply

[toc] | [next] | [standalone]


#2955

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2014-05-14 14:32 -0400
Message-ID<ll0cri$b85$1@dont-email.me>
In reply to#2954
On 5/14/2014 2:07 PM, Riya wrote:
> please help me to code in java..
> my project is related to cloudsim, where i am also using core java to code.
> Its mainly related to virtual machines(vm) and cloudlets/tasks, so each vm
> will be given a set of cloudlet and it has to execute.Now i have to find
> out how much each vm will cost if i assign particular amount to each one of
> them.
>
> I want to create two array which are 2 Dimensional.
> 1st array should contain "vm id"(1,2,3) and its "mips"(random values viz
> 50,100,150).
> 2nd array must have mips from 1st array and it should hold cost ( random
> value say 500, 1000, 1500).

     It sounds like your instructor is an old-line FORTRAN programmer:
Who else would use two-dimensional arrays for this sort of thing?  But,
okay, "A Real Programmer can write FORTRAN in any language," so:

	int[][] array1 = { {1, 50}, {2, 100}, {3, 150}, };
	int[][] array2 = { {1, 500}, {2, 1000}, {3, 1500}, };

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

[toc] | [prev] | [next] | [standalone]


#2956

Fromrossum <rossum48@coldmail.com>
Date2014-05-15 16:44 +0100
Message-ID<1vn9n9lqpj91vtm5lk7auv21t7d89bjgja@4ax.com>
In reply to#2955
On Wed, 14 May 2014 14:32:14 -0400, Eric Sosman
<esosman@comcast-dot-net.invalid> wrote:

>On 5/14/2014 2:07 PM, Riya wrote:
>> please help me to code in java..
>> my project is related to cloudsim, where i am also using core java to code.
>> Its mainly related to virtual machines(vm) and cloudlets/tasks, so each vm
>> will be given a set of cloudlet and it has to execute.Now i have to find
>> out how much each vm will cost if i assign particular amount to each one of
>> them.
>>
>> I want to create two array which are 2 Dimensional.
>> 1st array should contain "vm id"(1,2,3) and its "mips"(random values viz
>> 50,100,150).
>> 2nd array must have mips from 1st array and it should hold cost ( random
>> value say 500, 1000, 1500).
>
>     It sounds like your instructor is an old-line FORTRAN programmer:
>Who else would use two-dimensional arrays for this sort of thing?  But,
>okay, "A Real Programmer can write FORTRAN in any language," so:
>
>	int[][] array1 = { {1, 50}, {2, 100}, {3, 150}, };
>	int[][] array2 = { {1, 500}, {2, 1000}, {3, 1500}, };
Nah...  *Real* FORTRAN uses the FORTRAN naming conventions:

    int[][] ia1 = { {1, 50}, {2, 100}, {3, 150}, };
    int[][] ia2 = { {1, 500}, {2, 1000}, {3, 1500}, };

All integer variables start with the letters i .. n.  Short
meaningless names are real FORTRAN as well.

rossum (who prefers Algol to FORTRAN)

[toc] | [prev] | [next] | [standalone]


#2965

FromRoedy Green <see_website@mindprod.com.invalid>
Date2014-06-22 10:46 -0700
Message-ID<ti5eq9th4e4opqe2kpsmdk82u46urk0o0g@4ax.com>
In reply to#2954
On Wed, 14 May 2014 11:07:26 -0700 (PDT), Riya <riyaachar01@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>I want to create two array which are 2 Dimensional.
 see http://mindprod.com/jgloss/array.html
for the basics

Java multidimensional arrays are quite different from other languages.
Don't expect them to behave anything like what you are used to.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Why program by hand in 5 days what you can spend
2 to 5 years of your life automating.
~ Terence Parr 1964-08-17

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.help


csiph-web