Computers and Technology
Computers and Technology, 14.02.2020 05:15, kyle65

1) A String variable , fullName, contains a name in one of two formats:

last name , first name (comma followed by a blank), or

first name last name (single blank)

Extract the first name into the String variable firstName and the last name into the String variable lastName. Assume the variables have been declared and fullName already initialized . You may also declare any other necessary variables .

2)

Write a loop that reads strings from standard input where the string is either "land", "air", or "water". The loop terminates when "" (five x characters ) is read in. Other strings are ignored. After the loop, your code should print out 3 lines: the first consisting of the string "land:" followed by the number of "land" strings read in, the second consisting of the string "air:" followed by the number of "air" strings read in, and the third consisting of the string "water:" followed by the number of "water" strings read in. Each of these should be printed on a separate line.

ASSUME the availability of a variable , stdin, that references a Scanner object associated with standard input.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, detrickboucicaut
The fourth generation of computers emerged between 1970s and 1980s. which technological advancement brought about this generation of computers? which computer architecture was used most in this generation?
Answers: 3
image
Computers and Technology, 22.06.2019 23:00, cchotshot
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
image
Computers and Technology, 23.06.2019 06:00, sebcbal
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
image
Computers and Technology, 23.06.2019 09:10, babyskitt
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
Do you know the correct answer?
1) A String variable , fullName, contains a name in one of two formats:

last name , firs...

Questions in other subjects:

Konu
Mathematics, 19.10.2019 12:30
Konu
Mathematics, 19.10.2019 12:30
Konu
Mathematics, 19.10.2019 12:30