import java.util.*;
import java.lang.*;
import java.io.*;
class EncodeThePhase
{
public static void main (String[] args)
{
//set up keyboard input
Scanner scan = new Scanner(System.in);
//Ask for string from keyboard
System.out.println("Please input your phase:");
String input = scan.nextLine();
//Ask for an offset number
System.out.println("Please input your offset integer:");
int x = scan.nextLine();
//at the beginning we have not found any instances of the character
int seenChar = 0;
//go through each character of input and check to see if it
//is equal to searchChar
for(int count = 0; count < input.length(); count++)
{
//check if they're equal (we assume searchChar has length 1
//so we only look at the first character)
if(input.charAt(count) == searchChar.charAt(0))
{
//if they are equal, increase how many times we've seen the character
seenChar++;
}
}
//output the answer
System.out.println("The new Encode is " + newphase);
}
}
JCSOW 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.