subject

Java- string playwrite a program using scanner and its nextline method. the following is an example of how to use nextlinescanner kybd = new scanner(system. in); system. out. println("enter a line of text"); string aline = kybd. nextline(); if the user's input is shorter than 7 characters, print the message "the input is too short" and do no further processing. if the user's input is 7 characters or longer, perform the following operations. print either "the original string has no leading or trailing whitespace" or "the original string has leading or trailing whitespace." (hint: the trim method will be a good start, but you'll need more.)swap the first four and last three characters of aline and print the result. print aline in all upper case. print the compareto results of comparing aline in all lower case with the original aline. (this will be a number.)print whether the first half of aline is the same as the last half of aline except for case. print aline with the first 'c' 'c' 'd' or 'd' removed. note: treat each of these steps as an independent action operating on the original input. so if the original input waskilroy was here, but not godotswapping the first four and last three characters would printdotoy was here, but not gokilrand printing aline in all upper case would result inkilroy was here, but not godotyou may use only string's indexof, charat, length, compareto, touppercase, tolowercase, trim, equals, equalsignorecase and substring methods.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, kadariusmerchan
Determine which of the four levels of measurement (nominal, ordinal, interval, ratio) is most appropriate for the data below. internet speed levels of "fast comma " "medium comma " and "slow" choose the correct answer below. a. the ordinal level of measurement is most appropriate because the data can be ordered comma but differences left parenthesis obtained by subtraction right parenthesis cannot be found or are meaningless. nothing nothing nothing nothing nothing b. the interval level of measurement is most appropriate because the data can be ordered comma differences left parenthesis obtained by subtraction right parenthesis can be found and are meaningful comma and there is no natural starting point. c. the nominal level of measurement is most appropriate because the data cannot be ordered. nothing d. the ratio level of measurement is most appropriate because the data can be ordered comma differences left parenthesis obtained by subtraction right parenthesis can be found and are meaningful comma and there is a natural starting point.
Answers: 2
image
Computers and Technology, 21.06.2019 23:30, jcollings44
You picked the corridor which led you here. if the guards find you, they're going to be really angry! what is the synonym of angry
Answers: 1
image
Computers and Technology, 22.06.2019 17:40, lazerlemon500
Write a modular program (no classes yet, just from what you learned last year), that allows two players to play a game of tic-tac-toe. use a two-dimensional char array with 3 rows and 3 columns as the game board. each element of the array should be initialized with an asterisk (*). the program should display the initial board configuration and then start a loop that does the following: allow player 1 to select a location on the board for an x by entering a row and column number. then redisplay the board with an x replacing the * in the chosen location. if there is no winner yet and the board is not yet full, allow player 2 to select a location on the board for an o by entering a row and column number. then redisplay the board with an o replacing the * in the chosen location. the loop should continue until a player has won or a tie has occurred, then display a message indicating who won, or reporting that a tie occurred. player 1 wins when there are three xs in a row, a column, or a diagonal on the game board. player 2 wins when there are three ox in a row, a column, or a diagonal on the game board. a tie occurs when all of the locations on the board are full, but there is no winner. input validation: only allow legal moves to be entered. the row must be 1, 2, or 3. the column must be 1, 2 3. the (row, column) position entered must currently be empty (i. e., still have an asterisk in it).
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, magicalunicorns47
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
You know the right answer?
Java- string playwrite a program using scanner and its nextline method. the following is an example...

Questions in other subjects: