Question

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

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

1 public class Test { <terminated > Test (13) [Java Application) C:\Program Files\Java\jre 1.8.0_241\bin\javaw.exe ( NA 07303

public class Test {

    public static void main(String args[]) {
        String s = "I love discrete structures because it makes me a better computer scientist.";
        
        // A simple encoding can be done by changing the each character to its 3-digit integer
        // representation of ASCII value.
        StringBuilder sb = new StringBuilder();
        
        for(char c: s.toCharArray()) {
            sb.append(String.format("%03d ", (int)c));
        }
        System.out.println(sb.toString());
    }
}

**************************************************

Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.

Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.

1 public class Test { <terminated > Test (13) [Java Application) C:\Program Files\Java\jre 1.8.0_241\bin\javaw.exe ( NA 073032108111118101032100105115099114101116101032115116114117099116 public static void main(String args[]) { Strings = "I love discrete structures because it makes me a better computer scientist."; // A simple encoding can be done by changing the each character to its 3-digit integer // representation of ASCII value. StringBuilder sb = new StringBuilder(); for(char c: s.toCharArray()) { sb.append(String.format("%03d", (int)c)); System.out.println(sb.toString()); 14 } 15

Add a comment
Know the answer?
Add Answer to:
Java You are going to use the techniques you learned in number theory to create a...
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 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."

  • *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...

  • 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.

  • 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...

  • c++ please help You are going to create a PowerBall Lottery game with functions. First, you...

    c++ please help You are going to create a PowerBall Lottery game with functions. First, you are going to generate 5 UNIQUE numbers between 1 and 69. Then you are going to generate the powerball number, which is a number between 1 and 26. Next you are going to ask the user for 5 numbers. Users should only be allowed to enter numbers in the range 1-69 for regular numbers, 1-26 for powerball pick. You will compare each of the...

  • 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...

  • 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...

  • You are going to create a Queue. (alternately you can create a list and simply implement...

    You are going to create a Queue. (alternately you can create a list and simply implement enqueue and dequeue functions in the List – that will technically make it a queue). You will fill the first list with numbers consecutively numbered from 2 to n where n is entered by the user (we will call this Q1). When creating your Queue object use the correct function names for enqueue and dequeue functions. Again – sorry, cannot use an Javascript array...

  • PHP Programming Question. Use the techniques you learned so far to create an Address Book application...

    PHP Programming Question. Use the techniques you learned so far to create an Address Book application that stores names, e-mail addresses, and phone numbers in a text file. Validate all input fields and include functionality that allows the user to view the address book. Also, include code that sorts the address book by name and deletes duplicate entries. Each page in the application should have a link back to the main page. Be creative and add extra features if you...

  • USE JAVA PROGRAMMING LANGUAGE See all photos + Add to a ♡ Search Edit & Create...

    USE JAVA PROGRAMMING LANGUAGE See all photos + Add to a ♡ Search Edit & Create Share . Benny the Barber owns a one-chair shop. They told Benny that customers are not happy with waiting in lines and not get processed in order they arrived. As computer scientist, you are going to help Benny to write a Java program to manage waiting lines and to process customers in the same order they arrive. Here are the functional requirements of the...

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