You have entered a line that ends with a space and terminates with a full stop (.).Here is the Java program that reads a string input (terminated by a full stop) and displays all the tokens (words) from the string using the Scanner class: Read more
Applications With BlueJ |
||||||||||||||||||||||||||||||||||||
Write a program to create a Double Dimensional Array (DDA) as: Char ch=[ ] = new ch[3][3];This program creates a 3x3 Double Dimensional Array of characters and displays the characters located on the left diagonal, where the row and column indices are equal. Read more
Char ch=[ ] = new ch[3][3]; The program stores nine different characters in Double Dimensional Array. Display the characters of the left diagonal. g u f b c n Sample Output: s, u, n |
||||||||||||||||||||||||||||||||||||
Write a program to create a Double Dimensional Array (DDA) as: Char ch[ ][ ] = new ch[3][3];This program creates a 3x3 Double Dimensional Array of characters, stores nine different characters, and displays the vowels from the array. Read more
Char ch[ ][ ] = new ch[3][3]; The program stores nine different characters in Double Dimensional Array. Display the characters, which are vowels. w d a u m k Sample Output: e, a, u |
||||||||||||||||||||||||||||||||||||
Write a program in Java to create a Double Dimensional Array as int m[ ]=new int m[3][3] and to produce a printout as follows:Below is the Java program to create a 3x3 double-dimensional array and produce the specified printout. This involves initializing the array and printing two different patterns. Read more
1 0 1 0 1 0 0 1 0 0 0 1 |
||||||||||||||||||||||||||||||||||||
If arrays M and M+N are as shown below, Write a program in Java to find the array N.This Java program calculates array � from the given arrays � and � + � using element-wise subtraction and displays the resulting matrix. Read more
M = -3 -1 6 and M+N = 4 5 0 4 3 -1 1 -2 -3 |
||||||||||||||||||||||||||||||||||||
Using a Java program, create a 3*3 matrix and store the first nine natural numbers row-wise.This Java program creates a 3x3 matrix with the first nine natural numbers, calculates row sums, column sums, and diagonal sums (left and right), and displays the results. Read more
Now write a program to print the following output: a) Sum of the numbers in each row 4 5 6 7 8 9 |
||||||||||||||||||||||||||||||||||||
Write a program to store 6 elements in an array P and 4 elements in an array Q. Now, produce a third array R, containing all the elements of array P and Q.This Java program merges two arrays, P (6 elements) and Q (4 elements), into a third array R and displays the combined result. Read more
|
|
Input |
Input |
Output |
|
P[ ] |
Q[ ] |
R[ ] |
|
4 |
19 |
4 |
|
6 |
23 |
6 |
|
1 |
7 |
1 |
|
2 |
8 |
2 |
|
3 |
|
3 |
|
10 |
|
10 |
|
|
|
19 |
|
|
|
23 |
|
|
|
7 |
|
|
|
8 |
Read Answer
This Java program stores roll numbers and marks for 50 students in 3 subjects, calculates the average for each student, and identifies those with averages above and below 80.
Read more|
Roll No. |
Subject A |
Subject B |
Subject C |
|
…………………. |
…………………. |
…………………. |
…………………. |
|
…………………. |
…………………. |
…………………. |
…………………. |
|
…………………. |
…………………. |
…………………. |
…………………. |
Read Answer
This Java program stores 20 numbers in an array and displays only those numbers that are perfect squares by checking if their square roots are integers.
Read more|
n[0] |
n[1] |
n[2] |
n[3] |
n[4] |
n[5] |
n[6] |
n[7] |
n[8] |
n[9] |
|
12 |
45 |
49 |
78 |
64 |
77 |
81 |
99 |
45 |
33 |
This Java program stores 20 names, calculates the sum of ASCII values of the characters in each name, and displays the name with the highest sum of ASCII values.
Read moreYou
want to know the ASCII value of all the names of your friends. Write a program
to store 20 names in a Single Dimensional Array (SDA). Now, create another
array, which stores ASCII values of the corresponding names. Finally, display
the name having the highest ASCII value among the names.
This Java program allows the user to search for a name in a list of 10 names, and if found, it displays the name along with its corresponding telephone number. The search is case-insensitive.
Read moreWrite
a program to initialize an array of 10 names and initialize another array with
their respective telephone numbers. Search for a name by the User, in the list.
If found, display ‘Search Successful’ and print the name along with the
telephone number, otherwise display ‘Search Unsuccessful. Name not enlisted’.
This Java program stores 10 words in an array and displays only those that are palindromes. A palindrome is a word that reads the same forwards and backwards, and this is checked using a simple loop.
Read moreRead Answer
This Java program takes 5 words from the user, extracts the first letter of each word, sorts them in ascending order, and displays the resultant word. The sorting is done using Java's Arrays.sort() method.
Read moreRead Answer
This Java program stores 10 words/names in an array and displays only those that begin and end with a vowel. The program uses a helper method to check if a character is a vowel, ensuring case insensitivity.
Read moreRead Answer
This Java program stores 10 city names in an array and filters out those that begin with a consonant and end with a vowel. The program then displays the filtered city names in the output.
Read moreRead Answer
This Java program calculates the percentage and assigns grades to 100 students based on their marks in six subjects. It validates marks, computes percentages, and displays results in a tabular format.
Read more|
Percentage Marks |
Grade |
|
From 80 to 100 |
A |
|
From 60 to 79 |
B |
|
From 40 to 59 |
C |
|
Less than 40 |
D |
This Java program stores names and marks of 50 students in a subject. It calculates the average marks, identifies the highest mark, and displays the name of the top scorer with their marks. Input validation ensures marks are between 0 and 100.
Read moreRead Answer
This Java program stores the names and marks of 40 students in 5 subjects using arrays. Teachers can search for a student by name to view their marks and total. Case-insensitive search is implemented for flexibility.
Read moreA
class teacher wants to keep the records of 40 students in her class along with
the names and marks obtained in Eng, Hindi, Math, Science and Computer Science
in a D.D.A of 40*5. When the teacher enters the name of a student as an input,
the program must display the name, marks obtained in 5 subjects and the total.
Write a program in Java to perform the task.
This Java program stores visitor names for a 5-floor, 10-room hotel in a 2D array. It allows the user to search for a visitor by name and displays their floor and room number, or informs if they are not found.
Read moreA
Metropolitan Hotel has 5 floors & 10 rooms on each floor. The names of the
visitors are entered in D.D.A as [5][10]. The Hotel Manager wants to know from
the “Enquiry” about the position of a visitor (i.e. floor no. and room no.) as
soon as he enters the name of the visitor. Write a program in Java to perform
the above task.
This Java program calculates the total monthly sales for each store and department in a departmental shop using a 2D array. User inputs sales data, and the program computes and displays the totals for rows (stores) and columns (departments).
Read moreRead Answer