0% found this document useful (0 votes)
162 views

Assignment Day 5

The document contains 20 programming assignments related to strings and arrays in Java. Some of the key assignments include: writing a program to reverse a string using switch case, count vowels and consonants in a string, replace a character at a given position with another character, and evaluate a string to add "hp" or drop the first letter and add "hp" depending on if the first letter is a vowel or consonant. Other assignments involve string sorting, reversing strings and patterns, tokenizing a date string, finding maximum and minimum values in a matrix, and summing arrays using varargs.

Uploaded by

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

Assignment Day 5

The document contains 20 programming assignments related to strings and arrays in Java. Some of the key assignments include: writing a program to reverse a string using switch case, count vowels and consonants in a string, replace a character at a given position with another character, and evaluate a string to add "hp" or drop the first letter and add "hp" depending on if the first letter is a vowel or consonant. Other assignments involve string sorting, reversing strings and patterns, tokenizing a date string, finding maximum and minimum values in a matrix, and summing arrays using varargs.

Uploaded by

SaurabhSingh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment Day 5

1. write a program to find the length of a string and reverse it using switch case.
2. write a program to count no. of vowel and consonant in a string.
3. write a program to enter a string,a position where you want to change a character and a
character now replace it with given position.
4. write a program to enter a string and find the existence of a character(y/n), occurence of
a perticular character with position
5. write a program to enter a string and then find small letter,capitalletter,spaces,symbols
and total character in a string.
6. write a program that will evaluate a inputted string,look at first letter,determine if it is a
vowel then add 'hp' to the end of inputted string.if the first letter is not vowel then drop
the first letter and add 'hp' to the end.
7. write a program to print the string 'ALLAHABAD' in following formate
A
A L
A L L
A L L A
A L L A H
A L L A H A
A L L A H A B
A L L A H A B A
A L L A H A B A D
8. w.a.p. to enter a string,a substring of inputted string and replace it with another string.
9. w.a.p. create a class MyStr which has 2 methods to perform
(a)compare two string and check whether they are equal or not.
(b)concatenate 2 string
10. w.a.p to perform sorting on array of string.
11. W.a.p. to enter and print the reverse of string and pattern
12. Enter String: KANPUR
13. o/p should be:RUPNAK

R
RU
RUPc
RUPN
RUPNA
RUPNAK
14. write a program to enter a line and print each word in reverse in their position.
15. write a program to perform unsorting in a sorted array by using a function named
unsortArr,which takes sorted array as parameter and returns unsorted array.
16. W.A.P. to Calculate LCM of n numbers and HCM of n numbers using array.
17. W.A.P for use of String Tokenizer methods-countToken(),hasMoreElements(),
now enter a date and break it using delimeter '/'.
18. W.A.P. to find biggest and smallest number in the matrix.
19. W.A.P. to print both diagonal of a matrix and also print the sum of diagonals.
20. W.A.P for use of varargs, create a method SumArr which takes parameters
of type int array and returns sum of it.

You might also like