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]
2 years 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]2 years 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
Olivia creates a personal budget. She enters her current savings account balance in cell D3. In cell A3, she calculates her inco
alexdok [17]

Answer is :

=D3+A3-B3

These Cell address contain following statement:

D3= Olivia saving account balance

A3= Olivia 3 month income

B3= Olivia 3 month expense

so, Expense are also deducted from income and income is added into saving balance.

In this situation we are use this formula:

=D3+A3-B3

5 0
1 year ago
Show how to define a view tot_credits (year, num_credits), giving the total number of credits taken by students in each year
andreev551 [17]

Hi! I'm a Digital Marketer Intern at hotels.ng and I have a moderate knowledge on programming.

First, your  question is not very explanatory. The term "view" is often used in back-end web development. A view is simply a Python function that takes a Web request and returns a Web response.

But I'm not sure this is what you want, so I'll just go ahead and write a python function involving class to return the total number of credits taken by a student.

I'll answer this question using Python.

class student(object):  

    credits = None

    year = None

    def num_credits(self):


       #get credit value

       self.credits = input("Enter the total number of credits: "  )


       pass

    def getYear(self):

        self.year = input("Enter current year: ")

        pass

    def tot_credits(self):

          TotalCredits = tempTotalCredits + self.num_credits

           print "Your  total credits are :"+" "+str(TotalCredits)




3 0
2 years ago
Write a function summarize_letters that receives a string and returns a list of tuples containing the unique letters and their f
marysya [2.9K]

Answer:

Explanation:

2nd part

def summarize_letters(string):

#Initializaing a empty dictionary

character_counter = {}

#converting all the characters to lowercase

string_lower = string.lower()

for i in string_lower:

#checking if the chacter presents in the dictionary then increase it by one and also to check if the character is alphabet

if i in character_counter and i.isalpha():

character_counter[i] = character_counter[i]+1

#checking if the character not present in the dictionary then assign 1

if i not in character_counter and i.isalpha():

character_counter[i] = 1

#converting the dictionary to list of tuples

list_of_tuples = [(k, v) for k, v in character_counter.items()]

return list_of_tuples

#3rd Part

#initializing a string of characters in alphabets

alphabets = 'a b b b b B A c e f g d h i j k B l m M n o p q r s P t u v w x y z'

print(summarize_letters(alphabets))

#importing the string module

import string

#pulling all the alphabets

alphabet = set(string.ascii_lowercase)

#checking if our hardcoded string has all the alphabets

if set(alphabets.lower()) >= alphabet:

print('The string ' +alphabets+' has all the letters in the alphabet ')

3 0
2 years ago
A competitive analysis of Google and Microsoft would look at their ________ . Both pay high salaries and offer great benefits. B
Yuki888 [10]

Answer:

personnel strategy

Explanation:

Competitive analysis is a process that involves relating the company to its environment. Competitive analysis helps identify the strengths and weaknesses of the company, as well as the opportunities and threats that affect it within its target market. This analysis is the basis on which the strategy will be designed, for this we must know or intuit as soon as possible:

The nature and success of the probable changes that the competitor may adopt.

The probable response of the competitor to the possible strategic movements that other companies may initiate.

The reaction and adaptation to the possible changes of the environment that may occur from the various competitors.

The competition is made up of companies that operate in the same market and perform the same function within the same group of customers regardless of the technology used for it. It is not, therefore, our competitor that manufactures a generic product like ours, but one that satisfies the same needs as we do with respect to the same target or consumer audience, for example, cinema can be the theme parks competition, since both are embedded in leisure.

4 0
2 years ago
IANA has primarily been responsible with assigning address blocks to five regional internet registries (RIR). A tech needs to re
VikaD [51]

Answer:

The American Registry for Internet Numbers ARIN

Explanation:

The American Registry for Internet Numbers (ARIN) is a not for profit organization that serves as the administrator and distributor of Internet numeric resources such as IP addresses (IPv4 and IPv6) ASN for the United States, Canada, as well as North Atlantic and Caribbean islands

There are four other Regional Internet Registry including APNIC, RIPE NCC, LACNIC and AFRINIC.

6 0
1 year ago
Other questions:
  • Why would Network Systems employees be employed by the government?
    12·2 answers
  • The ________ program displays graphics and loading screens during the boot process.
    8·1 answer
  • Assume that the variables gpa, deansList and studentName, have been declared and initialized. Write a statement that adds 1 to d
    13·1 answer
  • Writing in Java, write a program that prompts the user to input an integer and then outputs both the individual digits of the nu
    15·1 answer
  • The process of converting information, such as text, numbers, photos, or music, into digital data that can be manipulated by ele
    7·1 answer
  • Prompt: Which references and reference formats are you most likely to use? Why?<br><br><br> ED2020
    13·2 answers
  • What three requirements are defined by the protocols used in network communications to allow message transmission across a netwo
    11·1 answer
  • ANSWER AS SOON AS POSSIBLE: When I try to join roblox adopt me it says: "Roblox Datastore servers are currently down. Please rej
    10·2 answers
  • We have an internal webserver, used only for testing purposes, at IP address 5.6.7.8 on our internal corporate network. The pack
    15·1 answer
  • A bank in your town updates its customers’ accounts at the end of each month. The bank offers two types of accounts: savings and
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!