this is what i got and am stuck...please helpp..thanks
[CODE=java]import java.util.Rando m; //Needed for Scanner class
import java.util.*;
/**
This program demonstrates value between 1 and 100 inclusive
*/
public class Value
{
public static int getValidValue()
{
Scanner keyboard = new Scanner(System. in);
int inputValue=0;
System.out.prin t("Enter an integer between" + "1 and 100;inclusive:" );
inputValue = keyboard.nextln ();
sum=n(n+1)/2;
System.out.prin tln(sum);
System.out.prin tln();
{
while (inputValue <1 ||inputValue > 100)
{
System.out.prin t("Invaalid value" + "enter a value between 1" + "and 100,inclusive:" );
inputValue = keyboard.nextIn t();
}
return(inputVal ue);
}
}
}[/CODE]
[CODE=java]import java.util.Rando m; //Needed for Scanner class
import java.util.*;
/**
This program demonstrates value between 1 and 100 inclusive
*/
public class Value
{
public static int getValidValue()
{
Scanner keyboard = new Scanner(System. in);
int inputValue=0;
System.out.prin t("Enter an integer between" + "1 and 100;inclusive:" );
inputValue = keyboard.nextln ();
sum=n(n+1)/2;
System.out.prin tln(sum);
System.out.prin tln();
{
while (inputValue <1 ||inputValue > 100)
{
System.out.prin t("Invaalid value" + "enter a value between 1" + "and 100,inclusive:" );
inputValue = keyboard.nextIn t();
}
return(inputVal ue);
}
}
}[/CODE]
Comment