import java.util.Scanner;//it is to take input from the
user
public class Main
{
public static void main(String[] args) {
String s;//s is first word
String s1;//s1 is second word
System.out.println("Enter 2 words (same
length):");
Scanner ob=new Scanner(System.in);//creatin
Object for Scanner
s=ob.nextLine();//taking s from the user
s1=ob.nextLine();//taking s1 from the user
char[] ch= s.toCharArray();//converting s to
chararray
char[] ch1 = s1.toCharArray();//converting s1 to
chararray
int n=s.length();
char[] ch2=new char[n+n];//creating final
chararray to store the new word
int j=n-1;
int m=n-1;
for(int i=0;i<(2*n);i++)//iteriting 2*n
times
{
if(i%2==0)//if even
index then procede with ch
{ ch2[i]=ch[m];
m--;}
else//if odd index then
procede with ch1
{
ch2[i]=ch1[j];
j--;
}
}
System.out.print("The new word is ");
for (char c : ch2) { //printing the resultant
array
System.out.print(c);
}
System.out.print("\nWhat
an odd word!");
}
}

JAVA LANGUAGE For this lab you are required to fulfill all requirements exactly as described in...
Today you are to write a Java program that will prompt for and
read 2 words of equal length entered by the user, and create a new
word which contains the last letter of the 1st word, the last
letter of the 2nd word, followed by the second to last character of
the 1st word, followed by the second to last character of the 2nd
word and so on. Be sure to use the same format and wording as in...
Capitalization JAVA In this program, you will read a file line-by-line. For each line of data (a string), you will process the words (or tokens) of that line one at a time. Your program will capitalize each word and print them to the screen separated by a single space. You will then print a single linefeed (i.e., newline character) after processing each line – thus your program will maintain the same line breaks as the input file. Your program should...
For this lab you will write a Java program that plays a simple Guess The Word game. The program will prompt the user to enter the name of a file containing a list of words. These words mustbe stored in an ArrayList, and the program will not know how many words are in the file before it starts putting them in the list. When all of the words have been read from the file, the program randomly chooses one word...
For this week's lab, you will use two of the classes in the Java Collection Framework: HashSet and TreeSet. You will use these classes to implement a spell checker. Set Methods For this lab, you will need to use some of the methods that are defined in the Set interface. Recall that if set is a Set, then the following methods are defined: set.size() -- Returns the number of items in the set. set.add(item) -- Adds the item to the...
***LOOPS NOT ALLOWED*** String variables and use of String methods: Write a complete Java program which prompts the user for a string with 3 words each separated by a single space and reads the line into one String variable using nextline(). Extract each word and add them to a new String variable in reverse order with a space between the words. Have the 1st letter of the new string in upper case and all other strings in lower case letter....
I am unsure on how to do this (java language) The program you must write needs to perform the following. 1. Read from stdin(System.in), up to 100 whitespace separated words, and store them in a data structure of your choice. 2. Calculate the average word length. 3. Print each word which is greater than the average length, in the reverse order thatthey were read in. 4. Print "Average: "followed the average word length to two decimal places. 5. If no...
For this week's lab, you will use two of the classes in the Java Collection Framework: HashSet and TreeSet. You will use these classes to implement a spell checker. Set Methods For this lab, you will need to use some of the methods that are defined in the Set interface. Recall that if set is a Set, then the following methods are defined: set.size() -- Returns the number of items in the set. set.add(item) -- Adds the item to the...
I have to use java programs using netbeans. this
course is introduction to java programming so i have to write it in
a simple way using till chapter 6 (arrays) you can use (loops ,
methods , arrays)
You will implement a menu-based system for Hangman Game. Hangman is a popular game that allows one player to choose a word and another player to guess it one letter at a time. Implement your system to perform the following tasks: Design...
Program In Assembly
For this part, your MAL program must be in a file named p5b.mal. It must have at least one function in addition to the main program. For the purposes of Part (b), you may assume the following 1. Any line of text typed by a user has at most 80 characters including the newline character. 2. A whitespace character refers to a space, a tab or the new line character. 3. A word is any sequence of...
In Java please
Only use methods in the purpose.
Thank you
The purpose of this assignment is to help you learn Java identifiers, assignments, input/output nested if and if/else statements, switch statements and non-nested loops. Purpose Question 2-String variables/Selection & loops. (8.5 points) Write a complete Java program which prompts the user for a sentence on one line where each word is separated by one space, reads the line into one String variable using nextline), converts the string into Ubbi...