Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Create a class called (Encrypter) to encrypt and decrypt text. Build a method called Encrypt to receive a string and return another string. The method will be static. Build a method called Decrypt to return the original string. The encryption method will be a very simple one: to encrypt add 1 to each character and to decrypt subtract 1to each character.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Similar questions
- When reading data from a text file, it is common to see numbers such as 12,345, $20, or 195*. Write a method that cleans a string containing digits by removing any characters that are not a digit or a - sign. Then convert to an integer and return the result. Numbers.java 1 public class Numbers 2 { /** Cleans a string containing an integer and converts it. @param number a string containing an integer and possibly extra characters @return the value of the number inside the string * / blic static int clean(String number) { 4 5 7 8 9 10 11 } 12 }arrow_forwardWrite a method myConcat that takes a string of multiple words and it returns a string made up of all the words concatenated together with the whitespace removed.arrow_forwardmodify it to create a classthat contains a static method; the method takes a string as a parameter andreturns a boolean value indicating whether the parameter string has repeatedcharacters in it or not. That is, return true if there is at least one characterwhich appear more than once in the string. The string should be input by the user public class Qns3 {public static void main(String args[]) { //input.Scanner Input = new Scanner(System.in);System.out.println ( "Enter the String to check for duplicate characters:");String k = Input.next();// repeated = true.boolean Repeat = false;for (int i = 0; i < k.length(); i++)for (int j = i + 1; j < k.length(); j++)if (k.charAt(i) == k.charAt(j))Repeat=true;if (Repeat){System.out.println("String have repeated characters" +k);}elseSystem.out.println( "String have no repeated characters" +k);} }arrow_forward
- The method printGroupSize() has an integer parameter. Define a second printGroupSize() method that has a string parameter. The second method outputs the following in order, all on one line: "A group of " the value of the string parameter "." End with a newline. Ex: If the input is 7 seven, then the output is: Order for size: 7 A group of seven. 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 public class GroupSize { publicstaticvoidprintGroupSize(intgroupSize) { System.out.println("Order for size: "+groupSize); } /* Your code goes here */ publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intsizeOfGroup; StringsizeInWord; sizeOfGroup=scnr.nextInt(); sizeInWord=scnr.next(); printGroupSize(sizeOfGroup); printGroupSize(sizeInWord); } }arrow_forwardDevelop a coding solution to perform the sorting per day (there are 7 days on which CSS perform sorting per day). For each of the days develop a class called CSSSorting, and for each day develop a method, something like: a. public static void CSSSortMonday(int[] values), b. public static void CSSSortTuesday(int[] values), c. public static void CSSSortWednesday(int[] values), d. public static void CSSSortThursday(int[] values) e. public static void CSSSortFriday(int[] values), f. public static void CSSSortSaturday(int[] values), g. public static void CSSSortSunday(int[] values) In each of these methods implement how you think the sorting should take place based on the each of the offered solutions/libraries.arrow_forwardWrite a java code for this. Strings Read the paragraph and encrypt the content using the following rules; "The String, StringBuffer, and StringBuilder classes are defined in java.lang. Thus, they are available to all programs automatically. All are declared final, which means that none of these classes may be subclassed. This allows certain optimizations that increase performance to take place on common string operations. All three implement the CharSequence interface." RULES The words ‘the’, ‘and’, and ‘for’ should be replaced by their reverse strings in upper case letters (use predefined functions reverse() and toupper()) The first occurrence of the word ‘are’ should be replaced by ‘AREERA’ and the last occurrence of the word ‘of’ to be replaced by ‘123’.arrow_forward
- Add a static method, public static void changeLetter (StringBuilder sb, char letter) Convert all occurrences of the letter variable in the StringBuilder to upper case. Write in java and use test case example as reference.arrow_forwardSuppose you are working with a class for manipulating images. This class has a method called resize. The method takes as input a double that is greater than or equal to 0, and the value is the proportion of the current size. So an input of 0.5 will half the size, 1.0 will keep it the same, and 2.0 will double the size. The method throws an IllegalArgumentException. Which of the following are true? Group of answer choices Which one the answer: Assume you have an image called Image1.png in the correct location. You also have the code:MyImage im = new MyImage(“Image1.png”);resize(1000.0);This code will result in an IllegalArgumentExceptionbeing thrown. Assume you have an image called Image1.png in the correct location. You also have the code:MyImage im = new MyImage(“Image1.png”);resize(0);This code will result in an IllegalArgumentExceptionbeing thrown. All of the other options are true. Assume you have an image called Image1.png in the correct location. You also have…arrow_forwardWrite a method getTopLevelDomain that accepts URL in String format then returns the top level domain. Write in java and use test case examples as result.arrow_forward
- Make a JAVA CODE for a word game. The game will start with each round where the server sends 17 random letters (with 5 to 7vowels) to all players where the goal of each player is to send a single valid word, with at least five (5)letters, that can be formed from the letters sent by the server. A letter in the 17 random letters may berepeated. Each player can submit as many words as possible within 10 seconds. Please note that I already have a txt file containing all the valid words that can be sent by the client. So all you have to do is help me out in constructing how I can conduct the rest of the code.arrow_forwardIn netbeans, Write a method named findLastTwoLetters that is passed a String parameter and that prints the last two letters of the string. For example, “ta” is returned if the parameter is “Roberta”. You are guaranteed as a precondition that the parameter will have a length greater than 1. This method can be completed using substring().arrow_forwardHow can you add a new line at the the end of of the output string in Java. The output is correct but it is requiring a new line I have done the System.out.println() after the 3rd method call, but it is still wrong. Here is the code with out the print line at the end and the results showing. The second picture is with the print line and showing the what is wrong as well import java.util.Scanner; public class LabProgram { //method drivingCost definition public static double drivingCost(double drivenMiles,double milesPerGallon,double dollarsPerGallon){ double yourValue; yourValue = (drivenMiles/milesPerGallon)*dollarsPerGallon; System.out.printf("%.2f ", yourValue); return yourValue;} public static void main(String[] args) { double milesPerGallon; double dollarsPerGallon; Scanner sc = new Scanner(System.in); milesPerGallon = sc.nextDouble(); dollarsPerGallon = sc.nextDouble(); drivingCost(10, milesPerGallon,…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY