exerciseFeb1108

exerciseFeb1108 - COMP202 Instructor: Ladan Mahabadi...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP202 Instructor: Ladan Mahabadi February 11, 2008 Caesar Cipher It is said that Julius Caesar used the following cipher to communicate in code with his soldiers. The cipher is a very simple substitution encryption scheme in which every character gets shifted to the right by three positions. In other words, ‘A’ becomes ‘D’ , ‘B’ becomes ‘E’, …, ‘Z’ becomes ‘C’ . Write a Java Program that receives an input string and using the Caesar cipher outputs the encrypted message. For instance, “RETURN TO ROME” should be outputted as “UHWXUA WR URPH”.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Replacement Method: Complete the implementation of the following method: /** * The replace method receives an input string and replaces every occurrence of * a particular character (someChar) with another (newChar). **/ Public static String replace (String input, char someChar, char newChar) { }
Background image of page 2
String Manipulation Exercise: Write a Java program that prompts the user with the following menu and displays the appropriate output based on user’s input until the user quits. Press
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/14/2008 for the course COMP 202 taught by Professor Verbrugge during the Winter '07 term at McGill.

Page1 / 4

exerciseFeb1108 - COMP202 Instructor: Ladan Mahabadi...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online