import java.util.Scanner;
public class main
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String input, scramble;
System.out.println("Input message to be coded: ");
input = keyboard.nextLine();
System.out.println("Input: " + input);
for (int i = 0; i < input.length(); i++)
{
scramble += scrambleMessage(input.charAt(i));
}
System.out.println("Coded message is: " + scramble);
}
public static char scrambleMessage( char c, int x)
{
int charc = c;
if (!Character.isLetter(c))
return c;
charc = (charc * (charc - 1))/(charc + (charc - 1)) + 5;
return (char)charc;
}
}
When I try and compile this code it says:
: error: method scrambleMessage in class main cannot be applied to given types;
scramble += scrambleMessage(input.charAt(i));
^
I don't understand what it is saying is wrong. The purpose of the program is to take the string entered in main and run it through the scrambleMessage() functions to change the letter up. I run it by running the string on a char by char basis, making each char it's corresponding number then remaking it a char. Not sure what is going on that is giving me this error.