Working no something for school and keep getting this.
\\filesvrcls\2011\stawil\Java\midterm2.java:37: illegal start of expression
public static int numsum(int a, int b)
^
\\filesvrcls\2011\stawil\Java\midterm2.java:60: class, interface, or enum expected
}
Process completed.
//***********************************************************
// midterm2.java Author: Will Stahl
//
// demonstrates Keyboard class
//***********************************************************
public class midterm2
{
public void main(String args[])
{
{
//declare variables
int a;
int b;
int c;
//accept inputs
System.out.print("Enter a positive integer: ");
a = Keyboard.readInt();
System.out.print("Enter a larger positive integer: ");
b = Keyboard.readInt();
if(b<a)
{System.out.print("Please enter a larger number then value:");
break;
}
if(a || b < 0)
{ System.out.print("Please enter a positive value!");
break;
}
}
public static int numsum(int a, int b)
{
//declare variables
int ans=1;
int a=c;
//accept inputs
while(true)
{
if(c==b-a+1)
break;
ans=c*ans;
c++;
}
//return
return ans;
}
}
}