Write a program by using scanner class to input a sentence.This Java program takes a sentence as input, finds the longest word, and displays the word along with its number of characters. Read more
|
Write a program to accept a sentence in a mixed case.This Java program accepts a sentence, counts the vowels in each word, and prints the words along with their vowel frequencies. Read more
Are 2 Learning 3 Scanner 2 Class 1 |
In a competitive examination, a set of 'N' number of questions results in True or 'False'. Write a program by using scanner class to accept the answers.This Java program accepts a set of 'True' or 'False' answers for a set of questions and displays the frequency of each. Read moreIn a competitive
examination, a set of 'N' number of questions results in True or 'False'. Write
a program by using the scanner class to accept the answers. Print the frequency of
'True' and 'False'. |
Write a menu-driven program to accept a number by using the scanner class. Perform the following tasks.This Java program provides a menu-driven interface that allows the user to check if a number is a Buzz number and display all the factors of the number excluding itself. Read more
a) Check and print whether the number is a 'Buzz number or not. A number is said to be a 'Buzz' number if it is divisible by 7 and it contains the last digits 7. |
Write a program (using scanner class) to generate a pattern of a token in the form of a triangle or in the form of an inverted triangle depending upon user’s choice.This Java program generates either a triangle or inverted triangle pattern of a token (*) based on the user's choice using the Scanner class. Read more
* * * * * * * * * * * * * * * * * * |
Write a program to accept a set of 50 integers. Find and print the greatest and the smallest numbers by using scanner class method.This Java program uses the Scanner class to accept 50 integers, then finds and prints the greatest and smallest numbers from the input. Read moreWrite
a program to accept a set of 50 integers. Find and print the greatest and the
smallest numbers by using the scanner class method. |
Write a program (Using scanner class) to input a line and display only numeric tokens.This Java program extracts and displays only the numeric tokens from a given line of text using the Scanner class. Read more
|
Using the scanner class, write a program to input 10 important cities with their STD code in two different single-dimensional arrays.This Java program uses the Scanner class to input 10 cities and their STD codes and displays only those cities that start with a vowel along with their corresponding STD codes. Read more
011 Asansol 0341 Indore 0731 ………….. ………….. Sample Output: Asansol 0341 ……….…. ………….. ……….…. ………….. |
Write a program (Using scanner class) to enter a token/word in a mixed case and display the new token after deleting all the vowels.This Java program removes all vowels from a mixed-case word and displays the new token using the Scanner class. Read more
|
Using the scanner class, write a program to input a line through the console.This Java program counts and displays the total number of uppercase and lowercase characters in a given line of text using the Scanner class. Read more
|
Write a program (using scanner class) to input any given token word to calculate the total number of characters and vowels present in the token.This Java program calculates the number of characters and vowels in a token and displays the reversed token using the Scanner class. Read more
Read Answer
Number of vowels: 01 Number of character: 05 Reversed token: YWONS |
Write a program (Using scanner class) to store 10 different words (in lower case) in a single-dimensional array.This Java program inputs 10 lowercase words, checks which words start and end with a vowel, and displays those words. Read more
Read Answer
Table Computer Agenda ………… ………… Sample Output: umbrella ………… ………… |
Using the scanner class, write a program to display the sum of even numbers and odd numbers separately from a set of numbers entered by the user.This Java program calculates and displays the sum of even and odd numbers separately from a set of user inputs, terminating when a non-numeric character is entered. Read moreUsing the scanner class, write a program to display the sum of even numbers and odd
numbers separately from a set of numbers entered by the user. The program
terminates when the user enters any non-numeric character. |
G.C.D. defined as the Greatest Common Divisor between the two numbers is calculated by the continued divisor method. i.e. Divide the larger number by the smaller, the remainder then divides the previous divisor.This Java program calculates the Greatest Common Divisor (GCD) of two numbers using the continued divisor method. Read more
Sample Output: GCD of two numbers is 5 |
Using the scanner class, write a program to find and display the sum of any ten numbers entered by the user from the console.This Java program calculates and displays the sum of ten numbers entered by the user using the Scanner class. Read moreUsing the scanner class, write a program to find and display the sum of any ten numbers
entered by the user from the console. |
Write a program (using scanner class) to generate a pattern of a token/word in the form of a triangle or in the form of an inverted triangle depending upon user’s choice.This Java program generates a triangle or inverted triangle pattern from a word based on user input. Read more
Enter your choice 2 Sample Output: C L A S S C L C L A S C L A C L A C L A S C L C L A S S C |
Using the scanner class, write a program to enter the string through a console and replace the token RED with GREEN without using the built-in function.This Java program replaces the token "RED" with "GREEN" in a string by manually processing the string without using built-in functions like replace(). Read more
|
Write a program to enter two tokens in mixed case.This Java program compares two tokens entered by the user and arranges them alphabetically based on their ASCII values, ignoring case. Read more
Sample Output: Computer, Science |
A computer typist has the habit of deleting the middle token ‘Kumar’ while entering the names containing three words/tokens.This Java program removes the middle token "Kumar" from a three-word name and displays the new name. Read more
|
Consider the String in lowercase as: the black cat ate the rat in the small houseThis Java program reads a string, splits it into words, and counts the occurrences of the token "the" in the string. Read more
|