1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zlopas [31]
3 years ago
11

What output is produced by the following program segment? Why? (Recall that name.charAt(i) is the i-th character in the string,

name.)
String name;
int i;
boolean startWord;

name = "Richard M. Nixon";
startWord = true;
for (i = 0; i < name.length(); i++) {
if (startWord)
System.out.println(name.charAt(i));
if (name.charAt(i) == ' ')
startWord = true;
else
startWord = false;
}
Computers and Technology
1 answer:
vekshin13 years ago
8 0

Answer:

The output is:

R

M

N

Explanation:

The code snippet print the beginning letter of each word in the given name.

In the for loop snippet:

first the program check if startWord is true and it is true, then it print the value of the character at index 0. Then it check if value of character is empty. If it is empty, startWord is initialized to true else it is initialized to false.

The loop only print a character when the value of i are 0, 8 and 11 which are also the beginning character of a word.

You might be interested in
Explain how the internet works​
yulyashka [42]

How does the Internet Work?

The Internet works through a packet routing network in accordance with the Internet Protocol (IP), the Transport Control Protocol (TCP) and other protocols.

Hope this helps you!

5 0
2 years ago
Read 2 more answers
Write the UPDATE command to increase the commission (column name :COMM) by 500 of all the salesman who have achieved sales (Colu
lara31 [8.8K]

Answer:

UPDATE COMPANY

SET COMM=COMM + 500

WHERE SALES> 20000;

Explanation:

The update command is used for alter the record in the database management system in the table .The update command command modify the record on the some condition in the table in the database management system.

Following are syntax for using the update command .

UPDATE table-name

SET column name 1,column name 2 .........

Where condition

  • In the given question table -name is "COMPANY" the condition is on the sales column and it update the table only when sales is more than 20000 and set the column COMM by 500.
4 0
3 years ago
What is a WYSIWYG program?
DanielleElmas [232]
D will be the answer a program that allows you to take a tutorial on html terminology
5 0
2 years ago
Read 2 more answers
in the future, mobile technologies are expected to be used more than desktop computers today. what other improvements are helpin
vekshin1

The improvement that are helping support mobile computing is increase data storage online and more applications for mobile phone.

If the data storage capacity is increased, we will get a larger amount to store our files. We get more space to store our important files and access them as easily as possible. Mobile applications need to be improved, because with more applications we will find it easier to use these applications to help us do our work. With a larger number of data storage, we could be comfortable because data storage can increase your employees' flexibility by enabling them to access data anytime they want from any location.

Learn more about data storage online at brainly.com/question/13650923

#SPJ4

4 0
1 year ago
Which is an example of a zero-point perspective?
kap26 [50]

i think its b sorry if  wrong

4 0
3 years ago
Other questions:
  • Which Game Is Better &amp; Favorite For You?
    12·2 answers
  • Utilities software and word processing software are both eamples of
    10·1 answer
  • What Will Social Media Look Like in the Future?
    6·1 answer
  • Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print o
    6·1 answer
  • Examine the following code.
    9·1 answer
  • Which of these is NOT a desktop computer operating system?
    8·2 answers
  • Which of the following statement is correct? Select one: a. Base register holds the size of a process. b. Limit register holds t
    10·1 answer
  • An end-user license agreement protects _____.
    7·1 answer
  • You use a Windows desktop system to edit and produce audio files. Your system has two hard disks installed. Your applications ar
    10·1 answer
  • Who designed the apple i computer in 1976?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!