Computer Science, asked by parthomsarwade, 1 year ago

write a menu driven program for both the patterns

please fast project Mai karna hai
I'll follow u and mark Brainliest
write in bluej language​

Attachments:

Answers

Answered by goyalbrothers77
3

B count 10 next letters you will get L

L count next 10 letters you will get U

U count next 10 letters you will get E

Continue counting and complete the pattern

Answered by siddhartharao77
15

Sample Program:

import java. util. *;

class brainly

{

public static void main(String args[])

{

System. out. println("Enter your choice : 1 (or) 2);

Scanner demo = new S canner(System. in);

int a = demo. nextInt();

System. out. println();

switch(a)

{

case 1:

int i,j;

for(i = 1; i <=5; i++)

{

for(j = 1; j<=5 - i + 1;j++)

{

System. out. print((char)(j+64));

}

System. out. println("");

}

break;

case 2:

String str="BLUEJ";

for(i = 0 ; i < str. length () - 1 ; i++)

{

for(j = str. length() ; j>i ; j--)

{

System. out. print("");

}

for(int k = 0; k <=i; k++)

{

System. out. print(str. charAt(i));

}

System. out. print("\n");

}

break;

default:

System. out. println("wrong choice");

}

}

}

Output:

Enter your choice: 1 (or) 2

1

ABCDE

ABCD

ABC

AB

A

Enter your choice: 1 (or) 2

2

B

LL

UUU

EEEE

Hope it helps!

Attachments:
Similar questions