subject

JavaAssignmentFirst, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).Then create a new Java application called "BackwardsStrings" (without the quotation marks) that:Prompts the user at the command line for one 3-character string. Then (after the user inputs that first 3-character string) prompts the user for another 3-character string. Then prints out the two input strings with a space between them. Finally prints on a separate line the two input strings 'in reverse' (see example below) with a space between them. So, for example, if the first string is 'usr' and the second string is 'bin', your program would output something like the following:The two strings you entered are: usr bin. The two strings in reverse are: nib rsu. Note that the reversed SECOND string comes FIRST when printing the strings in reverse. my result/*Name: Saima SultanaLab:PA - BackwardsStrings (Group 2)*/package backwardsstrings;import java. util. Scanner;public class BackwardsStrings { public static void main(String[] args) { //variables String first, second; // TODO code application logic here StringBuilder firstReversed= new StringBuilder(); StringBuilder secondReversed= new StringBuilder(); Scanner input = new Scanner(System. in); // read strings first=input. nextLine(); second=input. nextLine(); // print out the input strings System. out. println("The two string you entered are:"+ first+" "+second+"."); // reverse the strings for ( int i=first. length()-1;i>=0; i--) firstReversed. append(first. charAt(i)); for ( int i=second. length()-1;i>=0; i--) secondReversed. append(second. charAt(i));// print out the reverse string System. out. println("The two strings in reverse are:"+secondReversed+" "+ firstReversed+ ".");}}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:30, yayamcneal05
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, teamroper35
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
Answers: 1
image
Computers and Technology, 23.06.2019 23:30, ayjahj
What can you prevent issues related to downloading content form the internet
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, Auttyrain3929
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
You know the right answer?
JavaAssignmentFirst, launch NetBeans and close any previous projects that may be open (at the top me...

Questions in other subjects:

Konu
History, 21.09.2019 07:30