0% found this document useful (0 votes)
9 views3 pages

String Questios

The document contains a series of programming questions that require defining classes and writing programs in Java. Each question focuses on string manipulation, including counting characters, reversing cases, converting to Pig Latin, and searching for elements in arrays. The examples provided illustrate the expected input and output for each task.

Uploaded by

Devbrat Singh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

String Questios

The document contains a series of programming questions that require defining classes and writing programs in Java. Each question focuses on string manipulation, including counting characters, reversing cases, converting to Pig Latin, and searching for elements in arrays. The examples provided illustrate the expected input and output for each task.

Uploaded by

Devbrat Singh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Question 1 @2023

Define a class to accept a String and print the number of digits,


alphabets and special characters in the string.

Example:
S = "KAPILDEV@83"
Output:
Number of digits – 2
Number of Alphabets – 8
Number of Special characters – 1

Question 2 @2022

Define a class to accept a string, and print the characters with the
uppercase and lowercase reversed, but all the other characters
should remain the same as before.

EXAMPLE:
INPUT : WelCoMe_2022
OUTPUT : wELcOmE_2022

Question 3 @2019

Write a program to input a sentence and convert it into uppercase


and count and display the total number of words starting with a letter
'A'.

Example:

Sample Input: ADVANCEMENT AND APPLICATION OF


INFORMATION TECHNOLOGY ARE EVER CHANGING.

Sample Output: Total number of words starting with letter 'A' = 4


Question 4 @2013

Write a program in java to accept a word and display the same


in Pig Latin form. A word is framed in pig latin form by using the
following steps:-

i. Enter a word.
ii. Shift all the letters which are available before the first
vowel, towards end of the word.
iii. Finally add ‘AY’ at the end of the word.
Input:- TROUBLE
Output:- OUBLETRAY

Question 5 @2016

WAP in java to initialize the seven wonders of the world along with
their country name in two different arrays. Search for a name of the
country input by the user. If found, display the country along with its
wonder otherwise, display ‘Sorry Not Found!’

Seven Wonders: Chichen Itza, Christ the Redeemer, Taj Mahal,


Great wall of china, Machu Picchu, Petra, Colosseum.

Country: Mexico, Brazil, India, China, Peru, Jordan, Italy.

Input: Country Name: India

OutPut: India Taj Mahal

Input: Country Name: USA

OutPut: ‘Sorry Not Found!’


Question: 6

Question 7

BLUE
BLU
BL
B

You might also like