Results 1 to 2 of 2
  1. #1
    susan is offline Member
    Join Date
    Jul 2007
    Posts
    44
    Rep Power
    0

    Default Help with algorithm

    I am being told that "class" or "interface" expected for lines 8,11,42,42. i have no idea why. any help is accepted, here is the code

    Java Code:
    public class Marks
    {
    	public static void main(String args[]);
    	{
    		int[] marks = enterMarks();
    	}
    }
    static int counter=20;
    	
    	
    	public static int[] enterMarks()
    	{
    			int classMarks[]= new int[counter];
    			
    			for (int i=0; i<counter; i++)
    				{
    					classMarks[i] = getScannerInput.anInt("Please enter an integer value between 0 and 20 for each mark :");
    				}	
    					
    					System.out.println();
    					System.out.print("The marks entered were ");
    					
    					for (int j=0; j><counter; j++)
    						{
    							System.out.print(classMarks[j]+", ");
    						}	
    						return classMarks;	
    		}
    	
    	
    	public static int max(int arr[])
    		{
    			int[] marks = classMarks;
    			int tempStore=0;
    			for (int k=0;k<counter;k++)
    			{
    				if(marks[k]>marks[k+1])
    				tempStore=marks[k];
    			}
    			return tempStore;
    		}
    }
    Thanks

  2. #2
    asterope118 is offline Member
    Join Date
    Jul 2007
    Posts
    2
    Rep Power
    0

    Default

    On line 7 it looks like you have an extra '}' closing off your class. That might be the problem.

Similar Threads

  1. Modify A* Algorithm
    By prakharbirla in forum Advanced Java
    Replies: 1
    Last Post: 02-13-2008, 06:25 PM
  2. Help with making this algorithm better
    By RLRExtra in forum New To Java
    Replies: 6
    Last Post: 01-17-2008, 04:11 PM
  3. Help with sort algorithm
    By zoe in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:09 AM
  4. Help me with this algorithm
    By Marcus in forum Advanced Java
    Replies: 3
    Last Post: 07-02-2007, 01:30 PM
  5. Help with Algorithm
    By Daniel in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 05:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •