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
What law is someone punished for accessing a computer without permission?
podryga [215]
It depends the case. This is usually a computer crime. Many times depends on the state and that law that they have. It varies for punishment depending on how severely the crime was; meaning that there could potentially be jail time.
3 0
3 years ago
You want to create a hyperlink to a secure resource that ensures information is properly encrypted. you also want this link's co
ohaa [14]
Well, it kinda depends on the type of resource.
Lets say we are trying to access files or something. We could use the following link
<a href="ftps://SomeDotComSite"> Link to Resource</a>

If we are trying to access a page that gives us our resource we could use the following

<a href="https://SomeDotComSitePage"> Link to Page</a>


3 0
4 years ago
What are two types of system software
puteri [66]

Answer:

systems software and application software.

Explanation:

Systems software includes the programs that are dedicated to managing the computer itself, such as the operating system, file management utilities, and disk operating system

8 0
4 years ago
Java Eclipse homework. I need help coding this
Maslowich

public class ArithmeticAssignment {

   public static void main(String[] args) {

       Tester test = new Tester();

       test.printTester();

   }

   

}

class Tester{

   Tester(){

       

   }

   void printTester(){

       int i1 = 79 + 3 * (4 + 82 -68) - 7 +19;

       int i2 = (179 +21 +10) / 7 + 181;

       int i3 = 10389 * 56 * 11 + 2246;

       System.out.println(i1);

       System.out.println(i2);

       System.out.println(i3);

   }

}

I think this is what you wanted. I hope this helps!

5 0
3 years ago
Research and recommend the most appropriate VPN technology. The most likely solution is either an Internet Protocol Security (IP
chubhunter [2.5K]

Answer:

The five eras are general- purpose mainframe and minicomputer computing, personal computers, client/server networks, ...

7 0
3 years ago
Other questions:
  • Computer models are the only type of model that can be used to make predictions. Please select the best answer from the choices
    10·2 answers
  • The voluntary linkage of computer networks around the world is called the ______.
    7·1 answer
  • Help!!! Who is this? Who is it from?
    14·2 answers
  • What are some activities that work especially well in Outline view? Check all that apply.
    5·2 answers
  • Can anyone help me<br> I will make you a brainalist
    13·1 answer
  • Select the correct answer.
    6·1 answer
  • Why is it difficult to detect a Trojan horse?
    13·2 answers
  • Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any n
    12·1 answer
  • In the ( ) Model, each in a network can act as a server for all the other computers sharing files and acsess to devices
    11·1 answer
  • Reesa works for a large real estate company. She is responsible for installing and supporting the company's internet systems, in
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!