DOWNLOAD
import java.util.Scanner;
public class Chapter12
{
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
String encrypt, decrypt; //Holds text for ecryption or decryption
int shift; //Holds shift value used to produce encrypted or plain text
System.out.print("Please enter text to encrypt"); //Gets user to enter text for encryption
encrypt = stdIn.nextString(); //Output the entered text from user
System.out.print("Please enter shift value"); //Gets user to enter value to shift entered text to produce encryption
shift = stdIn.nextInt(); //Output the entered value from user
for (String text; text<=encrypt; text++)
{
for (int value=1; value<=shift; value++)
{
System.out.print(printEncrypton);
}
System.out.println();
}
System.out.print("Please enter text to decrypt"); //Gets user to enter text for encryption
decrypt = stdIn.nextString(); //Output the entered text from user
System.out.print("Please enter shift value"); //Gets user to enter value to shift entered text to produce encryption
shift = stdIn.nextInt(); //Output the entered value from user
for (String text; text<=decrypt; text++)
{
for (int value=1; value<=shift; value++)
{
System.out.print(printDecrypton);
}
System.out.println();
}
} //end main method
} //end class
import java.util.Scanner;
public class Chapter12
{
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
String encrypt, decrypt; //Holds text for ecryption or decryption
int shift; //Holds shift value used to produce encrypted or plain text
System.out.print("Please enter text to encrypt"); //Gets user to enter text for encryption
encrypt = stdIn.nextString(); //Output the entered text from user
System.out.print("Please enter shift value"); //Gets user to enter value to shift entered text to produce encryption
shift = stdIn.nextInt(); //Output the entered value from user
for (String text; text<=encrypt; text++)
{
for (int value=1; value<=shift; value++)
{
System.out.print(printEncrypton);
}
System.out.println();
}
System.out.print("Please enter text to decrypt"); //Gets user to enter text for encryption
decrypt = stdIn.nextString(); //Output the entered text from user
System.out.print("Please enter shift value"); //Gets user to enter value to shift entered text to produce encryption
shift = stdIn.nextInt(); //Output the entered value from user
for (String text; text<=decrypt; text++)
{
for (int value=1; value<=shift; value++)
{
System.out.print(printDecrypton);
}
System.out.println();
}
} //end main method
} //end class
Комментариев нет:
Отправить комментарий