![]() Question 10 Define a class and store the given city names in a single dimensional array. Perform selection sort on the integers and then print them in ascending order. Ģ) Write a program to accept 15 integers from the keyboard, assuming that no integer entered is a zero. Sample input : Olympics Sample Output : OLYMPICSYZġ) Write a program to initialize the given data in an array and find the minimum and maximum values along with the sum of the given elements. Sample input : Flowers Sample Output: OWERSFLYZ The alphabets present before the vowel being shifted towards the end following by “YZ”. To translate a word into a Piglatin word, convert the word into upper case and then place the first vowel of the original word as the start of the new word along with the remaining alphabets. Write a program that encodes a word into Piglatin. Write a program to accept a word check and print whether the word is a palindrome or only special word. Palindrome words are those words which read the same from left to right and vice-versa.Įxamples: MALAYALAM, MADAM, LEVEL, ROTATORĪll palindromes are special words, but all special words are not palindromes. ![]() Special words are those words which start and end with the same letter. Example : 25 is an automorphic number as its square is 625 and 25 is present as the last two digits. b) Automorphic number : An automorphic is the number which is contained in the last digit of the square.a) Prime number : A number is said to be a prime number if it is divisible only by 1 and itself and not by any other number.Write a menu driven program to accept a number and check and display whether it is a prime number or not OR an automorphic number or not. ii) void polygon(int x, int y) : with two integer arguments that draws a filled rectangle of length x and breadth y using the symbol void polygon() : with no argument that draws a filled triangle shown below.I) void polygon(int n, char ch) : with one integer argument and one character type argument that draws a filled square of side n using the character stored in ch. Such that the logic of the program is clearly depicted.įlow-Charts and Algorithms are not required.ĭesigna class to overload a function polygon() as follows: The answers in this Section should consist of the Programs in either BlueJĮnvironment or any program environment with Java as the base.Įach program should be written using Variable descriptions/Mnemonic Codes Given that in x= What are the values of p and q?Īttempt any four questions from this Section.Write two difference between linear search and binary search.Give two differences between the switch statement and if else statement.What will be the value of x and y, if n assumes a value i)1 ii) 0 ? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |