1. A Ghosh

PROGRAM
ROGRAM
OGRAM
GRAM
RAM
AM
M

2. Shardul

Display the following pattern using iteration statement:
+
+ –
+ – +
+ – + –
+ – + – +

3. Yuvraj

HAPPY
APPY
PPY
PY
Y

4. P
PRO
PROGR
PROGRAM

5. Akshvedh

Code for
5
4
3
2
1

6. write a program to print:

ABCDEDCBA
ABCD DCBA
ABC CBA
AB BA
A A

7. sara

what would be code for:
AAAA
BBBB
CCCC
DDDD

8. Sourish

What type of code will be for the following:
R
ER
TER
UTER
PUTER
MPUTER
OMPUTER
COMPUTER

9. Jolly biju

How to write the code for
* *
* *
**
* *
* *

10. Jolly biju

WHat will be the code for the pattern
* * * *
* *
* *
* * * *

11. PRASHANT

what will be code for
AAAAA
BBBB
CCC
DD
E

I am a complete beginner in programming and I am having difficulties to solve this problem.
Each letter is converted to the letter which
is 3 places after it in the alphabets. For example, A is converted to D.
The sequence is cyclic, that is, X is converted to A, Y to B and Z to C.
Write a java program that allows you to input a line of text and
outputs the encrypted version. The line of text is terminated by a ‘.’.
This is what I got so far:
import java.util.scanner
public class ReplaceString {

public static void main(String[] args) {
string str=”Meet me at Times Square tonight.”
System.out.println(str replace (all letters by the fourth letter found after it in alphabetical order,
a=d,
b=e,
c=f,
d=g,
e=h,
f=i,
g=j,))
// loop till alphabetical cycle is complete.
}
}
phhw ph dw wlphv vtxdvh wrqljkw

• ``````
public static String convert(String str) {
char[] charray = str.toCharArray();
StringBuilder sb = new StringBuilder(str.length());
int i = 0;
while (i < charray.length) {
if (Character.isLetter(charray[i])) {
char ch = (char) (charray[i] + 3);
sb.append(ch);
} else if ((char) charray[i] == ' ') {
sb.append(' ');
}

i++;
}
return sb.toString();
}
``````