Advertisements
Advertisements
Write a program to input a number and check and print whether it is a Pronic number or not. (Pronic number is the number which is the product of two consecutive integers).
Examples: 12 = 3 × 4
20 = 4 × 5
42 = 6 × 7
Concept: undefined > undefined
Write two separate programs to generate the following patterns using iteration (loop) statement:
(b)
Concept: undefined > undefined
Advertisements
Special words are those words that start and end with the same letter.
Examples:
EXISTENCE
COMIC
WINDOW
Palindrome words are those words which read the same from left to right and vice versa
Examples:
MALAYALAM
MADAM
LEVEL
ROTATOR
CIVIC
All palindromes are special words, but all special words are not palindromes. Write a program to accept a word check and print Whether the word is a palindrome or only a special word.
Concept: undefined > undefined
Write a program in Java to accept a string in lower case and change the first letter of every word to upper case. Display the new string.
Sample input: we are in a cyber world
Sample output: We Are In Cyber World
Concept: undefined > undefined
Write a program to input and store roll numbers, names and marks in 3 subjects of n number students in five single dimensional array and display the remark based on average marks as given below : (The maximum marks in the subject are 100).
Average marks = `"Total marks"/3`
Average marks | Remark |
85 - 100 | Excellent |
75 - 84 | Distinction |
60 - 74 | First-class |
40 - 59 | Pass |
Less than 40 | Poor |
Concept: undefined > undefined
Write a program to input twenty names in an array. Arrange these names in descending order of alphabets, using the bubble sort technique.
Concept: undefined > undefined
Which of the following are valid comments ?
(i) /* comment */
(ii) /* comment
(iii) / / comment
(iv) */ comment */
Concept: undefined > undefined
Name the primitive data type in Java that is:
A 64-bit integer and is used when you need a range of values wider than those provided by int.
Concept: undefined > undefined
Name the primitive data type in Java that is :
A single 16-bit Unicode character whose default value is ‘\u0000’.
Concept: undefined > undefined
Operators with higher precedence are evaluated before operators with relatively lower precedence. Arrange the operators given below in order of higher precedence to lower precedence.
- &&
- %
- >=
- ++
Concept: undefined > undefined
Give two differences between the switch statement and the If-else statement.
Concept: undefined > undefined
What is an infinite loop ? Write an infinite loop statement.
Concept: undefined > undefined
when is a constructor invoked?
Concept: undefined > undefined
Study the method and answer the given questions.
public void sampleMethod()
{ for (int i=0; i < 3; i++)
{ for (int j = 0; j<2; j++)
{int number = (int) (Math.random() * 10);
System.out.println(number); } } }
(i) How many times does the loop execute ?
(ii) What is the range of possible values stored in the variable number ?
Concept: undefined > undefined
Study the method and answer the given questions.
public void sampleMethod()
{ for (int i=0; i < 3; i++)
{ for (int j = 0; j<2; j++)
{int number = (int) (Math.random() * 10);
System.out.println(number); } } }
(i) How many times does the loop execute ?
(ii) What is the range of possible values stored in the variable number ?
Concept: undefined > undefined
Using the switch statement, write a menu driven program to calculate the maturity amount of a Bank Deposit.
The user is given the following options :
(i) Term Deposit
(ii) Recurring Deposit
For option (i) accept principal (P), rate of interest(r) and time period m years(n). Calculate and output the maturity amount (A) receivable using the formula
`"A" = "P"[1+"r"/100]^"n"`
For option (ii) accept Monthly Installment (P), rate of interest (r) and time period in months (n). Calculate and output the maturity amount (A) receivable using the formula
`"A" = "P" xx "n" + "P" xx ("n"("n" + 1))/2 xx "r"/100 xx 1/12`
For an incorrect option, an appropriate error message should be displayed.
Concept: undefined > undefined
Write a program to accept the year of graduation from school as an integer value from, the user. Using the Binary Search technique on the sorted array of integers given below.
Output the message “Record exists” If the value input is located in the array. If not, output the message “Record does not exist”.
{1982, 1987, 1993, 1996. 1999, 2003, 2006, 2007, 2009, 2010}.
Concept: undefined > undefined
State the value of y after the following is executed:
char x = '7';
y = Character.isLetter(x);
Concept: undefined > undefined
The access modifier that gives the most accessibility is ______
Concept: undefined > undefined
The Scanner class method used to accept words with space:
Concept: undefined > undefined