Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Compiled Languages > Java   »   i dont understand whats wrong,

 
Thread Tools Display Modes
Question
 
 
#1  
Old Nov 9, 2007, 11:09 AM
albear's Avatar
albear
Senior Member
albear is offline
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
i dont understand whats wrong,

anyhelp would be great thank; ok then i have my code:

class MySums // to calculate the average of three numbers,
//one dealing with integers, the other with double
{
public static void main ( String [] args)

{

averageI(23, 45, 89);


}
public static int averageI (int num1, int num2, int num3)
{

int num4 = ((num1 + num2 + num3)/3);

return num4;

// calcualte the average of the three numbers
// return the average

}

public static void averageI (double Num1, double Num2, double Num3)
{

double Num4 = ((Num1 + Num2 + Num3)/3);

return Num4;

System.out.println("integer average is " + averageI(23, 45, 89));
}
}

its suppost to return the values Num4 and num4, but it says

'cannot return a value from method whose result type is void, return Num4'
^(this is supposed to go under the N of Num4)

i dont know what the problem means so i dont know how to correct it.

Reply With Quote
 
     

Answers
 
 
Old Nov 9, 2007, 11:26 AM   #2  
Senior Member
albear is offline
 
albear's Avatar
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
any suggestions?
  Reply With Quote
 
     
 
 
Old Nov 9, 2007, 11:43 AM   #3  
Senior Member
albear is offline
 
albear's Avatar
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
at all?
  Reply With Quote
 
     
 
 
Old Nov 9, 2007, 04:14 PM   #4  
Senior Member
albear is offline
 
albear's Avatar
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
somebody?
  Reply With Quote
 
     
 
 
Old Nov 10, 2007, 07:56 AM   #5  
Senior Member
albear is offline
 
albear's Avatar
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
anybody?
  Reply With Quote
 
     
 
 
Old Nov 10, 2007, 12:38 PM   #6  
Senior Member
albear is offline
 
albear's Avatar
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
hello..........
  Reply With Quote
 
     
 
 
Old Nov 11, 2007, 12:19 PM   #7  
Senior Member
albear is offline
 
albear's Avatar
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
please.....
  Reply With Quote
 
     
 
 
Old Nov 14, 2007, 07:22 PM   #8  
New Member
qcumber is offline
 
Join Date: Nov 2007
Posts: 5
qcumber See this member's comment history on his/her Profile page.
your static method ... instead of

public static void etc etc ... you should change it to include a return type ... for example,

public static int or public static double .. etc etc
  Reply With Quote
 
     
 
 
Old Nov 20, 2007, 12:42 PM   #9  
Senior Member
albear is offline
 
albear's Avatar
 
Join Date: Apr 2007
Location: strawberry fields
Posts: 718
albear See this member's comment history on his/her Profile page.
thank you, it was that
  Reply With Quote
 
     


Thread Tools
Display Modes

 
Similar Sponsors

Similar Threads
Question Asker Forum Answers Last Post
dont know whats wrong with me akms Mental & Emotional Health 50 Nov 18, 2007 01:03 PM
i dont no whats wrong and im worried blondbitts Women's Health 4 Nov 18, 2007 12:59 PM
I Dont Know Whats Wrong With Me. mandieluu Children 10 Jul 27, 2007 04:55 PM
my dog looks sick but i dont know whats wrong with it jordancraigwood Dogs 1 Feb 7, 2007 02:26 AM
help me to understand whats going on Jac Psychics 3 Sep 2, 2005 05:46 AM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 05:24 PM.