Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help, when i run the following code, as shown in the pictures attached after the code there are 2 parts were i get

i need help, when i run the following code, as shown in the pictures attached after the code there are 2 parts were i get a bracket ([) instead of a alpabetical letter, the two bracket symbols shold be both converted to 'A' instead as shown in the attrachment of the project discription. how do i fix this issue, all the other parts of the string convert to the correct letters....

import java.util.Scanner; public class VigenereEncodingFinal { public static void main(String[] args) { try (Scanner keyboard = new Scanner(System.in)) { String key = "KHOSHAVI"; //System.out.print("(Using All Capital Letters) "); // System.out.print("Enter the Key: "); // String key = keyboard.nextLine(); System.out.println("Please enter a text to encode: "); String message = keyboard.nextLine(); String encodedMessage = encodeMessage(message, key); System.out.println("String: " + message); System.out.println("Encoded message: " + encodedMessage); System.out.println("Plain Text : " + message); // + decodeMesssage(encodedMessage, key)); } } private static String decodeMesssage(String encodedMessage, String key) { String res = ""; encodedMessage = encodedMessage.toUpperCase(); for (int i = 0, j = 0; i = 'A' && c = 'A' && c

}

image text in transcribed

image text in transcribed

Output-HW1VigenereEncoding (run) #2 x Please enter a text to encode: A HEALTHY ATTITUDE IS CONTAGIOUS BUT DONT WAIT TO CATCH IT FROM oTHERS String: A HEALTHY ATTITUDE IS CONTAGIOUS BUT DONT WAIT TO CATCH IT FROM OTHERS [ RH UKPTHJL JVP HZVI PIJP CZ KRKI EC QZDF WUDNt A HEALTHY ATTITUDE IS CONTAGIOUS BUT DONT WAIT TO CATCH IT FROM OTHERS Encoded message: L PTTTUDH LBIBEVZ .. Plain Text BUILD SUCCESSFUL (total time: seconds) Hw1VigenereEncoding (run) running. 51:9 INS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions