• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SiMpLe Program but......I still beginner

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,
I have a simple question which Write a method that computes the average, min and max of the values in an array of doubles. The header of the method is as follows:
public static double average(double[] x)
public static double min(double[] x)
public static double max(double[] x) As a beginner java programmer I still have problems in my code.. Could you help me to fetch the true answer.

Code:
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Step 1... You need to make sure that your program can compile first. If you can't compile, you can't run. If you can't run, you can't test. If you can't test, you can't figure out what is wrong. If you can't figure out what is wrong, you can't fix.

So... Does the program compile? What issues are you having when you try to compile it?

Henry
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And when you post a thread, please tell us what the thread is about in its title. And use the code button to make your code easier to read.
 
Um Hassan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when I compile the program I saw something isn't expected with {......}. Here you are the compile message.
,Regards
compile_error.JPG
[Thumbnail for compile_error.JPG]
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

That's a task list of errors in your program. You need to click each one. The IDE will take you to the error, with icons that explain the error. And you need to fix it.

Showing us the task list is pretty useless -- as we don't get any details about the error.


BTW, for a beginner, it is recommended to not use an IDE. An IDE takes care of tons of stuff, that a beginner needs to learn. I highly recommend that you use the standard javac compiler.

Henry
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at lines 6 and 7 of your program:

What are 'b' and 'c'? You haven't declared variables named 'b' and 'c' anywhere, so the compiler doesn't know what you mean there.
 
It runs on an internal combustion engine. This ad does not:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic