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
10 points!
melisa1 [442]

Advantages;            

Firstly, the internet can let a person to communicate with people in virtually any parts of the world through the internet or e-mail, without having to leave his room. E-mail allowed peoples to communicate with minimum of times. It is now possibles to send a message to any parts of the world through a simple e-mail address and the message is delivered in matter of seconds. Every companies is using e-mail in business. The convenience of e-mail has allowed businesses to expand and communicates with their vendors and customers located all over the world in records times. Personal communication has also become more easier thanks to e-mail. Chat rooms, video conferencing are some of the latest additions in this technology and these have allowed peoples to chat in real time. Besides, there are a lot of messengers services in offering. With the help of such services, it has become very easy to establish a kind of global friendship where you can share your thoughts and explore other cultures. The internet also allows people within an organization to easily communicate and share informations.

Second, information is probably the biggest advantages that internet offers. Internet is a virtual treasures trove of information. Any kinds of information on any topic under the sun is available on the internet. The search engines like Google, Yahoo are at your service through the internet. There is a huge amount of information available on the internet for just about every subjects known to man, ranging from government law and services, trade fairs and conferences, market information, new ideas and technical support, the lists is simply endless. We can uses these search engines, websites dedicated to different subjects and large amount of articles and papers are available for perusal in a matter of a few seconds.

Forums on a number of sites allow peoples to discuss and share their thoughts and informations with others located at different places all over the world. Whether this information is the latest news happenings in the world or information about your favourite celebrity, everything is available at your finger tips. A huge cache of data is available on the internet on every single subjects. With this storehouse of information people can not only increases their knowledge bank but can do so without wasting their time through traditional means such as visiting libraries and conducting exhaustive research. With internet, students can save their times to search for information and using their time to do other works.

This is particularly relevant for students who can use this wealth of information for their school projects and also learn new things about the subjects they are interested in. In fact this internet is for many schools and universities that are now able to assigns projects and work to the students and follows their progress which can be easily posted on the school or university internal websites. Online education has grown at a very fast pace since internet allow the development and uses of innovative tools for imparting education. University students and lecturers can communicate through internet. Besides, some universities are also offerings far distances courses to make study become more inefficient and convenience. Internet become a gateway for those who wants to learn but cannot afford the living fees at foreign countries.

Thirdly, entertainments is another popular reasons why many people prefer to surf the internet. In fact, the internet has becomes quite successful in trapping the multifaceted entertainment industry. Downloading games or just surfing the celebrity websites are some of the uses people have discovered. Even celebrities are using the internet effectively for promotional campaigns. Besides that, there are numerous games that can be downloaded for free. The industry of online gaming has tasted dramatic and phenomenal attentions by game lovers. The internet has also revolutionized the entertainments industry. People nowadays no need to go to a cinema hall to watch your favourite movie. Instead of watching movies at cinema now have companies offering their services where you just can downloads or order your favourite movie and watch it with a fast internet connection. Besides that, you also can download other important software or your favourite music in a matter of few minutes. There are a number of shareware programs that allow you to share and download your favourite music and videos. The internet also allows people from different cultures and background to connect with each other. Internet gaming is a huge business and allow enthusiastic gamers to compete against each other in games even when they are located far apart. Likewise dating has also allowed people to find their prospective soul mates.

4 0
3 years ago
What are you required to verify before allowing a person to operate your pwc?
stich3 [128]

<span>Before allowing a person to operate PWC, check that they meet the minimum age and boater education requirements for PWC. While near shore, show how to start and re board the PWC properly and make sure that he has at least 25 hours of PWC operation experience. Be sure explain how to steer and control the PWC properly.</span>

8 0
3 years ago
________ is a record in a relational database.
leonid [27]

The answer that is a record in a relational database is called; A row

<h3>What is a record in relational database?</h3>

In relational databases, a record is defined as a group of related data held within the same structure. Furthermore, we can say that a record is a grouping of fields within a table that reference one particular object.

Now, in relational database, a row is called a record because each row, contains a unique instance of data or key for the categories defined by the columns.

Read more about Relational Database at; brainly.com/question/13262352

#SPJ12

4 0
2 years ago
Write an if-else statement that displays 'Speed is normal' if the speed variable is within the range of 24 to 56. If the speed v
kari74 [83]

Answer:

import java.util.Scanner;

public class Speed{

int speed;

public Speed(int speed){

this.speed = speed;

}

public void checkSpeed(){

if(speed >= 24 || speed <= 56){

System.out.println("Speed is normal");

}

else

System.out.println("Speed is abnormal");

}

public static void main(String...args){

Scanner input = new Scanner(System.in);

int userSpeed = 0;

System.out.println("Enter a speed: ");

userSpeed = input.nextInt();

Speed obj1 = new Speed(userSpeed)

obj1.checkSpeed();

}

Explanation:

4 0
4 years ago
Passwords are usually alphanumeric and usually cannot contain spaces or ________.
vlada-n [284]

Answer:

The answer is A. Punctuation.  A password can contain symbols

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • When using a template to compose a memorandum which key on the keyboard moves the cursor to the next field
    15·1 answer
  • What block cipher mode of operation involves each ciphertext block being fed back into the encryption process to encrypt the nex
    12·1 answer
  • Classes cannot:
    10·1 answer
  • Write a complete Java method that returns an integer. The method declares a Scanner object, then prompts the user for a series o
    12·1 answer
  • If there are 8 opcodes and 10 registers, a. What is the minimum number of bits required to represent the OPCODE? b. What is the
    10·1 answer
  • Which button could Pamela press in the Microsoft Word spell checker to make the word “colour” instantly change to “color” whenev
    11·1 answer
  • Many of the first photographers were actullay scientists and inventors
    11·1 answer
  • Write a Java application that uses the Math class to determine the answers for each of the following: a. The square root of 37 b
    10·1 answer
  • Declare a typedef struct named jumper_t that will have four parts: character array name that is 16 in length, double array of tr
    12·1 answer
  • Read the ages of three people and find the average. Display the result.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!