2 Replies - 236 Views - Last Post: 27 January 2013 - 11:24 PM Rate Topic: -----

#1 compcode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 27-January 13

problem to create java program using array

Posted 27 January 2013 - 11:29 AM

problem to create java program using array in the following 1. Accept 5 input nos. & compute for its average and sum. 2. Accept 5 input nos. & display the highest and lowest number.
Is This A Good Question/Topic? 0
  • +

Replies To: problem to create java program using array

#2 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2553
  • View blog
  • Posts: 10,637
  • Joined: 20-September 08

Re: problem to create java program using array

Posted 27 January 2013 - 11:33 AM

Dup
Was This Post Helpful? 0
  • +
  • -

#3 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: problem to create java program using array

Posted 27 January 2013 - 11:24 PM

Well, here is something to give you a start.

1. Accept 5 input nos. //use a for loop...take the contents into an array...remember index is 0 to 4  for 5 elements
  sum // in the same for loop...add all the contents of array
  compute for its average//divide sum value by 5

2. Accept 5 input nos.//same as above
   display the highest //sort the array and a[4] will be highest
   lowest number. // a[0] will be lowest
  


regards,
Raghav
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1