You are on page 1of 3

Computer Science and Engineering

Course Title: Data Communication Lab


Course Code: CSE 308
Class Work: 05

Submitted by: Submitted to:

Name: Ujjal Kumar Roy Mr. Montaser Abdul Quader


ID: 191002326
Section: 192-DC Lecturer

Department of CSE Department of CSE


Green University of Bangladesh Green University of Bangladesh

Date of Submission: 15-04-2021

©Ujjal Kumar Roy Page. 1


Code:

package Encription;

import java.util.Scanner;

public class Encript {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter the Messege: ");

String text = sc.nextLine().replace(' ', ' ');

System.out.print("Enter the Key: ");

int key = sc.nextInt();

System.out.println(text);

char[] msg_data = new char[text.length()];

for (int i=0;i<text.length();i++){

msg_data[i] = text.charAt(i);

char ch = (char) (msg_data[i]+3);


System.out.print(ch);
}
}
}

©Ujjal Kumar Roy Page. 2


Code Screen Shot:

Output:

©Ujjal Kumar Roy Page. 3

You might also like