Question

(Java code only)You are going to use the techniques you learned in number theory to create...

(Java code only)You are going to use the techniques you learned in number theory to create a cipher. Do not use any libraries for your cipher, instead create your own algorithm from scratch.

Cipher the following text: "I love discrete structures because it makes me a better computer scientist."

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.util.*;
  
class Main
{
public static void main(String args[ ])
{
//string variable declaration
String plainText, cipherText="";
  
//display message
System.out.print("Enter the String you want to Encrypt: \n");
try
{
Scanner in=new Scanner(System.in);
  
//get input from the user
plainText = in.nextLine();
  
for (int i=0; i<plainText.length(); i++)
{
char ch = Character.toLowerCase(plainText.charAt(i));
int c = ch;
c = c + 5;
ch = (char) c;
cipherText = cipherText + ch;
}
}
  
//catch exception
catch(Exception ioe)
{
ioe.printStackTrace();
}
  
//display cipher text
System.out.println("The cipher text is: \n" +cipherText);
}
}

OTUPUT:

Enter the String you want to Encrypt: I love the discrete structures because it makes me a better computer scientiest. The ci

Add a comment
Know the answer?
Add Answer to:
(Java code only)You are going to use the techniques you learned in number theory to create...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Java You are going to use the techniques you learned in number theory to create a...

    Java You are going to use the techniques you learned in number theory to create a cipher. Do not use any libraries for your cipher, instead create your own algorithm from scratch. Cipher the following text: "I love discrete structures because it makes me a better computer scientist." Please use numbers for the cipher

  • *USE JAVA In this project you will create program that calculate the number of times every...

    *USE JAVA In this project you will create program that calculate the number of times every word appears in a given text file. Your program will take in the name of the file as well as the number of threads to create to speed up the process. The numbers of threads must be greater than 0. The output will be saved into a file in alphabetical order. Besides creating the program itself, you are to run experiments to show how...

  • Please help me code the following in: JAVA Please create the code in as basic way...

    Please help me code the following in: JAVA Please create the code in as basic way as possible, so I can understand it better :) Full points will be awarded, thanks in advance! Program Description Write a program that demonstrates the skills we've learned throughout this quarter. This type of project offers only a few guidelines, allowing you to invest as much time and polish as you want, as long as you meet the program requirements described below. You can...

  • Code In Python Well Document Code Every Line Please * You cannot use any external Python...

    Code In Python Well Document Code Every Line Please * You cannot use any external Python libraries. You can, of course, import the libraries that are included in the standard Python installation though. * Your software must use selection (if, if/ else, etc.) and repetitive (for, while, etc) control structures and have programmer defined functions. * Make sure you understand the code you submit since you will be expected to answer questions about it. The way the program should work...

  • Code In Python Well Document Code Every Line Please 5 Stars * You cannot use any...

    Code In Python Well Document Code Every Line Please 5 Stars * You cannot use any external Python libraries. You can, of course, import the libraries that are included in the standard Python installation though. * Your software must use selection (if, if/ else, etc.) and repetitive (for, while, etc) control structures and have programmer defined functions. * Make sure you understand the code you submit since you will be expected to answer questions about it. The way the program...

  • Code In Python Well Document Code Every Line Please * You cannot use any external Python...

    Code In Python Well Document Code Every Line Please * You cannot use any external Python libraries. You can, of course, import the libraries that are included in the standard Python installation though. * Your software must use selection (if, if/ else, etc.) and repetitive (for, while, etc) control structures and have programmer defined functions. * Make sure you understand the code you submit since you will be expected to answer questions about it. The way the program should work...

  • USING JAVA, Use the binary search algorithm to create a game where you think of the...

    USING JAVA, Use the binary search algorithm to create a game where you think of the number and the computer guesses it. The computer should be able to guess any number between 1 and 500. When the computer chooses a number, you need to tell it if the guess is too high or too low. Have the program print out the number of guesses that it took to guess the number.

  • PYTHON CODE DOCUMENT EVERY LINE * You cannot use any external Python libraries. You can, of...

    PYTHON CODE DOCUMENT EVERY LINE * You cannot use any external Python libraries. You can, of course, import the libraries that are included in the standard Python installation though. * Your software must use selection (if, if/ else, etc.) and repetitive (for, while, etc) control structures and have programmer defined functions. * Make sure you understand the code you submit since you will be expected to answer questions about it. The way the program should work is the same as...

  • Create a table named Quiz within a database called ExamDB. You should use the embedded Java...

    Create a table named Quiz within a database called ExamDB. You should use the embedded Java DB mode to implement this database. Data is stored in a text file in the following csv format (questionNumber, description, choice1, choice2, choice3, choice4, Answer). Create your own csv text file containing quiz questions. Read from this file and store the records in the Quiz table within the ExamDB database. Give the user a simple MCQ test from your Quiz table with 3 questions...

  • Please use Java and only Java. You have been hired by your favorite restaurant to create...

    Please use Java and only Java. You have been hired by your favorite restaurant to create a food nutrition app for their customers to use. Before you get too far, the owner wants you to create a quick prototype. Your app should output a food name and the number of calories, then ask the customer how many they want. You need to ask them for 3 menu items. Once they tell you the quantity for the three menu items, you...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT