Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.help Subject: Re: core java coding.. pls help ! Date: Wed, 14 May 2014 14:32:14 -0400 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <54e9c913-a553-4faa-be8d-9f483f4bca34@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 14 May 2014 18:32:19 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="bd4e1cba8d8592bec5d5ed9e4537fbfd"; logging-data="11525"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/c+QuSWalbDljlqa3lUFfq" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <54e9c913-a553-4faa-be8d-9f483f4bca34@googlegroups.com> Cancel-Lock: sha1:VNmqiLBxcl6n2/OiBiKKZC2QT70= Xref: csiph.com comp.lang.java.help:2955 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