answer.
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
Charra [1.4K]
1 year ago
5

How many times does the following loop execute?int upperCaseLetters = 0;String str = "abcdEfghI";boolean found = false;for (int

i = 0; i < str.length() && !found; i++){char ch = str.charAt(i);if (Character.isUpperCase(ch)){found = true;}}
Computers and Technology
1 answer:
damaskus [11]1 year ago
7 0

Answer:

Five times

Explanation:

Given the codes as follows:

  1.        int upperCaseLetters = 0;
  2.        String str = "abcdEfghI";
  3.        boolean found = false;
  4.        for (int i = 0; i < str.length() && !found; i++)
  5.        {
  6.            char ch = str.charAt(i);
  7.            if (Character.isUpperCase(ch))
  8.            {
  9.                found = true;
  10.            }
  11.        }

The for loop will stop when the first uppercase letter is found in the str. This condition is set in the for loop condition ( i < str.length() && !found)

Since the the first upper case letter is the fifth character in the given str, the for loop will run for five rounds. In the fifth round the condition in the if statement (Line 9) will be evaluated to true and then set the true value to found variable (Line 11). This will terminate the loop in the next iteration.

You might be interested in
How did josh norman and mike keller provide coverage of katrina?
Digiron [165]
<span>They wrote live updates to a blog, so D. The blog was called "Eye of the Storm." It was written as a series of personal musings and photographs of places where the storm hit- first hand accounts of the disaster. They received a journalism award for it.</span>
6 0
1 year ago
Read 2 more answers
4.17 LAB: Data File A comma separated value (.csv) file has been included to be used for this program. Each line contains two va
Andrej [43]

Answer:

import csv

def Csvreader(filename):

   with open("filename", "r") as file:

   content = file.csv_reader()

   list_content = list(content)

   file.close

   return list_content

Explanation:

This is a python description of the function that reads the csv file and converts it to a list, from the list, each item can accessed with its index and updated directly. Use this to draw the same conclusion for a java program.

7 0
1 year ago
Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off. The follow
Dafna11 [192]

Answer:

1)

officeAC = new AirConditioner();

officeAC.turnOn();

2)

officeAC = new AirConditioner();

officeAC.turnOn();

officeAC.setTemp(69);  

Explanation:

1)

In the first statement a new object of the class AirConditioner whose reference is assigned to the officeAC. new is a keyword which creates an object of the class.

Next statement uses the method turnOn(). Reference to the new object officeAC is used to invoke this method turnOn().

2) The first two statements works the same as in 1)

The last statement invokes a method setTemp() using the reference variable and passes the value 69 to this method to set the desired temperature.

6 0
1 year ago
Access to sensitive or restricted information is controlled describes which of the key communications and information systems pr
Viktor [21]

Answer:

C: Security

Explanation:

Communications and information systems principles need to be, among other things, secure. They need to be able to protect sensitive information from those who intentionally not need to know. Some incident information like voice, networks, and data, are very sensitive and thus, should be secure to the right levels and should comply with privacy laws and data protection.

4 0
2 years ago
Which of the following can be managed using Active Directory Users and Computers snap-in?
Goryan [66]

Answer:

The answer is "Option b".

Explanation:

The active directory can manage the data with active directory customers but a snap-on machine. It is used in scrolling the list, as the earlier replies demonstrate. It will appear on the screen if there is no other startup software installed on a computer.  

This snap-on desktop is only a component, that allows its simultaneous use of different systems or devices on the very same system. It also turns the objects more or less into the pieces of the whole.

7 0
1 year ago
Other questions:
  • How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
    5·1 answer
  • In 2–3 sentences, describe how you would change the background of a group of cell
    6·2 answers
  • An mp3 takes up about 16 kilobytes of memory per second of music. if you owned a one terabyte hard drive and filled it with only
    15·1 answer
  • Assume that the reference variable r refers to a serializable object. Write code that serializes the object to the file ObjectDa
    8·1 answer
  • A small company is moving towards sharing printers to reduce the number of printers used within the company. The technician has
    14·1 answer
  • Assume that a gallon of paint covers about 350 square feet of wall space. Create an application with a main() method that prompt
    9·1 answer
  • Within a word processing program, predesigned files that have layout and some page elements already completed are called text bo
    15·1 answer
  • A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
    6·1 answer
  • A colleague sent you an awesome article about using proper ergonomics while sitting at the computer. You don't have time to read
    11·1 answer
  • In a particular field, there are trees in a l single row from left to right. Each tree has a value V You cut trees from left to
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!