The CountLetters application is limited to counting letters in a single word. Modify the CountLetters application to count the letters in an entire phrase, which contains spaces. Care must be taken to ignore the spaces and any other non alphabetic character found in the phrase. Be sure to change comments and variable names appropriately so that the reader of the application code understands that the letters in a phrase are counted.


import java.util.Scanner;

public class CountLetters {

public static void main(String[] args) {
final int LOW = 'A'; //smallest possible value
final int HIGH = 'Z'; //highest possible value
int[] letterCounts = new int[HIGH - LOW + 1];
Scanner input = new Scanner(System.in);
String phrase;
char[] wordLetters;
int offset; //array index

/* prompt user for a phrase */
System.out.print("Enter a phrase: ");
phrase = input.nextLine();
input.close();

/* convert word to char array and count letter occurrences */
phrase = phrase.toUpperCase();
wordLetters = phrase.toCharArray();
for (int letter = 0; letter < wordLetters.length; letter++) {
offset = wordLetters[letter] - LOW;
letterCounts[offset] += 1;
}

/* show letter occurrences */
for (int i = LOW; i <= HIGH; i++) {
System.out.println((char)i + ": " + letterCounts[i - LOW]);
}
}

}


Answers

Answer 1
what are you trying to say here? do you need help? Or ..?
Answer 2
You can’t put it lines of code like that it’s not that easy to figure out what your trying to say in Java script

Related Questions

In Illinois, once a person has obtained their boating education certificate what is the minimum age to operate a motorized vessel without adult supervision?

Answers

Answer:

I dont really know, I am sorry, but I am going to ask my teacher

No one under 10 years of age should legally operate any type of motorboat. People at the age 10 or 11 years may not operate any type of motorboat unless they are supervised by a parent or a guardian, or a competent adult who is at least 18 years old, designated by a parent or whoever is watching you.

what are some preventions and treatments for the listing below?
-Human papillomavirus
-Chlamydia
-Trichomoniasis
-Gonorrhea
-Syphilis
-HIV/AIDS

Answers

#1: Electrosurgery
#2: Antibiotics
#3: Treatment involves both partners taking one large dose of a certain oral antibiotic.
#4: Gonorrhea can be treated with antibiotics.
#5: Syphilis is treated with penicillin. Sexual partners should also be treated.
#6: HIV antiviral
Lastly: Are you okay?
Condoms help somewhat

In Florida, bike lanes are painted

Answers

Answer: green

Explanation:

The answer will be Green.!!

3. Airbags are supplemental protection and are designed to deploy in all crashes.
A. O TRUE
B. O FALSE

Answers

Hi there!

The answer would be A. True

Hope this helps !

Airbags are supplemental protection and are not designed to deploy in all crashes. Therefore, it's false.

What are airbag?

It should be noted that airbags are out in vehicles in order to reduce the impact on an individual during accidents.

Therefore, airbags are supplemental protection and are not designed to deploy in all crashes. They're designed to work with seatbelts.

Learn more about airbag on:

brainly.com/question/2607849

#SPJ9

What is one way a C47 can be used on set?

Answers

Answer:

C47 may seem like a fancy word, but in the film world, it is the name of one of the simplest, most useful and versatile tools, which is commonly knows as a clothespin.

Following are major uses of C47 on a film set.

1) Lightning Purposes

C47 are used for attaching materials like gel and diffusion to the adjustable flaps, that control the direction of light

2) Adjusting Wardrobes

C47 are used to shorten, tighten or redesign a material of clothing for a specific purpose. It avoids permanent change and the hassle of sewing.

3) Modifications

These can be used for temporary repairs or to modify the set and shooting locations, e.g if a curtain is not hanging properly, C47 can be used

It transfers military men

Florida's No-Fault requires owners of motor vehicles must cover the
below minimum Personal Injury Liability (PIP) insurance coverage:
o $10,000 of Personal Injury Protection (PIP)
o $30,000 of Personal Injury Protection (PIP)
o $50,000 of Personal Injury Protection (PIP)
o $100,000 of Personal Injury Protection (PIP)

Answers

Answer:

The correct option is;

$10,000 of Personal Injury Protection (PIP)

Explanation:

Personal injury protection, PIP, otherwise known as No-Fault Law coverage is a part of auto insurance that takes care of medical cost of treatment of an accident victim regardless of who is at fault

In Florida, the No-Fault Law requires motor vehicle owners to have and retain PIP providing $10,000 in medical care, resulting disability and expenses of a funeral resulting from an accident in which the motorist is involved

Therefore, the correct option is $10,000 of Personal Injury Protection.

What they said^^^^^^^

Pure ethanol has an octane rating of about 113. E85, Which contains 35 percent oxygen by weight, has an octane rating of about

Answers

The octane rating for E15 (15% ethanol) is 88 octane and E85 (85% ethanol) is 108 octane. In addition, as Argonne National Laboratory states, ethanol reduces greenhouse gas emissions between 34 to 44 percent compared to gasoline.
108 octane is the correct or best anwser it is very close

A refrigerated space is maintained at -15℃, and cooling water is available at 30℃, the refrigerant is ammonia. The refrigeration capacity is 105 kJ/h. If the compressor is operated reversibly:

(1) What is the value of ε for Carnot refrigerator?

(2) Calculate the ε for the vapor-compression cycle;

(3) Calculate the circulation rate for the refrigerant;

(4) Calculate the rating power of the compressor.​

Answers

Answer:

(1) 5.74

(2) 5.09

(3) 3.05×10⁻⁵ kg/s

(4) 0.00573 kW

Explanation:

The parameters given are;

Working temperature, [tex]T_C[/tex]  = -15°C = 258.15 K

Temperature of the cooling water, [tex]T_H[/tex] = 30°C = 303.15 K

(1) The Carnot coefficient of performance is given as follows;

[tex]\gamma_{Max} = \dfrac{T_C}{T_H - T_C} = \dfrac{258.15}{303.15 - 258.15} = 5.74[/tex]

(2) For ammonia refrigerant, we have;

[tex]h_2 = h_g = 1466.3 \ kJ/kg[/tex]

[tex]h_3 = h_f = 322.42 \ kJ/kg[/tex]

[tex]h_4 = h_3 = h_f = 322.42 \ kJ/kg[/tex]

s₂ = s₁ = 4.9738 kJ/(kg·K)

0.4538 + x₁ × (5.5397 - 0.4538) = 4.9738

∴ x₁ = (4.9738 - 0.4538)/(5.5397 - 0.4538) = 0.89

[tex]h_1 = h_{f1} + x_1 \times h_{gf}[/tex]

h₁ = 111.66 + 0.89 × (1424.6 - 111.66) = 1278.5 kJ/kg

[tex]\gamma = \dfrac{h_1 - h_4}{h_2 - h_1}[/tex]

[tex]\gamma = \dfrac{1278.5 - 322.42}{1466.3 - 1278.5} = 5.09[/tex]

(3) The circulation rate is given by the mass flow rate, [tex]\dot m[/tex] as follows

[tex]\dot m = \dfrac{Refrigeration \ capacity}{Refrigeration \ effect \ per \ unit \ mass}[/tex]

The refrigeration capacity = 105 kJ/h

The refrigeration effect, Q = (h₁ - h₄) = (1278.5 - 322.42) = 956.08 kJ/kg

Therefore;

[tex]\dot m = \dfrac{105}{956.08} = 0.1098 \ kg/h[/tex]

[tex]\dot m[/tex] = 0.1098 kg/h = 0.1098/(60*60) = 3.05×10⁻⁵ kg/s

(4) The work done, W = (h₂ - h₁) = (1466.3 - 1278.5) = 187.8 kJ/kg

The rating power = Work done per second = W×[tex]\dot m[/tex]

∴ The rating power = 187.8 × 3.05×10⁻⁵ = 0.00573 kW.

What they said up there above me is true :)

The practice of honoring those who have been lost in battle dates back to which two ancient
civilizations?

Answers

It was between Iranians and filapinons nice work man it’s easy
Indus River valley civilizations I don’t really know anymore on the top of my headache

What type of damage is reduced by installing impact resistant glass functional shutters and double door top and bottom latches

Answers

Answer: you are reducing bullet damage or the damage of a person getting shattered glass all over them

Explanation: i dont

have one

Hinges will out weigh the needed amount

Luis is installing some 12 gage wire. How much resistance will there be throughout a distance of 400 feet

Answers

Answer:

0.635 m

Explanation:

When calculating the resistance R of a wire, we need  its length(l), its cross-sectional area (A) and the resistivity of the material(ρ). The resistance of a wire  is given by the equation:

Resistance (R) = Resistivity(ρ) × length (l) / cross-sectional area (A)

For a 12 guage wire,

Resistivity (ρ) = 1.724 × 10 ⁻⁸ ohm m, length (l) = 400 ft = 121.92 m,

Diameter (d) = 0.00205232, cross-sectional area (A) = πd²/4 = π(0.00205232)²/4 = 3.31 × 10 ⁻⁶ m²

[tex]R=\frac{\rho l}{A}=\frac{1.724*10^{-8}*121.92}{3.31*10^{-6}} =0.635m[/tex]

The answer is 0.635 m that’s the answer
Other Questions
A food chain is a simple way of showing the relationships between organisms in an ecosystem. What do we call a diagram that shows the complex feeding relationships between organisms in an ecosystem? Hot and Cold has annual sales of $847,000, annual depreciation of $47,000, and net working capital of $43,000. The tax rate is 21 percent and the profit margin is 7.3 percent. The firm has no interest expense. What is the amount of the operating cash flow was The Erie Canal was one reason that manufacturers had to increase the prices of goods being shipped to the Midwest. What is the original source of energy for gasoline?O plantsO SunO petroleumO fossil fuels What is the inverse of g(x) =X +8 |6-27| how the answer this question How did Rosa Parkss choice to remain seated bring about change in Montgomery and other places? When you learned about the Highway Transportation system you learned about 6 different types of people as roadway users. Choose 3 and explain a safe driving skill response for each. How do the laws we read connect government and religion? The Hernandez family budget is shown in the graph.A circle graph titled Family Budget. Housing is 23 percent, Food is 21 percent, Savings is 10 percent, Transportation is 16 percent, medical is 12 percent, clothing is 13 percent, emergency fund is 5 percent.Which 3 categories make up more than half of the Hernandez family budget? Select two choices..clothing, medical, and emergency fundclothing, housing, and savingshousing, savings, and foodhousing, food, and transportationfood, transportation, and emergency fund which statement provides the best argument against making major changes to the atmosphere to help protect Earth's resources Give four examples of common indoor pollutants, four examples of common outdoor pollutants, and two examples of sources of hazardous waste. Which image shows -1 7/8 on a number line? A. B. C. D. why is it important for students to take drama? Can someone please answer my question: What is 72% of 54? How does the division of powers affect Americans today? Find the sum of (1-1/n) + (1-2/n) + (1 - 3/n)....upto n terms A cone holds 450 gallons of water. How many gallons of water will a cylinder hold if it has the same base area and height as the cone? Select the correct answer.Is this a SENTENCE?Do our leaders always tell the truth?OAYesB.No A music teacher asked 23 students in the band how many hours they practiced playing their instrument each week. The results are shown in the dot plot. Which statement best describes the data?