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
Alex777 [14]
3 years ago
15

The CountLetters application is limited to counting letters in a single word. Modify the CountLetters application to count the l

etters 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]);
}
}

}
Engineering
2 answers:
insens350 [35]3 years ago
5 0
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
Bond [772]3 years ago
4 0
What are you trying to say here? do you need help? Or ..?
You might be interested in
The thrust angle is checked by referencing
anygoal [31]

In Engineering, the thrust angle is checked by referencing: C. vehicle centerline.

<h3>What is a thrust angle?</h3>

A thrust angle can be defined as an imaginary line which is drawn perpendicularly from the centerline of the rear axle of a vehicle, down the centerline.

This ultimately implies that, the thrust angle is a reference to the centerline (wheelbase) of a vehicle, and it confirms that the two wheels on both sides are properly angled within specification.

Read more on thrust angle here: brainly.com/question/13000914

#SPJ1

5 0
2 years ago
Gold forms a substitutional solid solution with silver. Calculate the number of gold atoms per cubic centimeter (in atoms/cm3) f
bija089 [108]

Answer:

Na = 5.911 × 10^{21}  atoms/cm³

Explanation:

given data

silver-gold alloy  C Au = 17 wt%

densities ρ Au = 19.32 g/cm³

densities ρ Ag = 10.49 g/cm³

atomic weights A Au  = 196.97 g/mol

atomic weights A Ag  = 107.87 g/mol

solution

we will apply here formula for number of gold atoms that is

Na = \frac{NA * C Au}{\frac{C Au * A Au}{\rho Au} + \frac{A Au * (100-C Au)}{\rho Ag}}        ............................1

here NA is Avogadro's number and ρ  is density of two element and A is atomic weight

put here value

Na = \frac{6.022*10^{23} * 0.17}{\frac{0.17 * 196.97}{19.32} + \frac{196.97 * (100-0.17)}{10.49}}

Na = 5.911 × 10^{21}  atoms/cm³

8 0
4 years ago
Your employer has the ability to protect you from cave-ins and other hazards by using adequately-designed protection systems in
Rus_ich [418]

Answer:15

Explanation:

5 0
4 years ago
Typical metals show elastic-plastic behaviour in tension and shear but not in compression. a)True b)- False
bagirrra123 [75]

Answer: True

Explanation:Typical metals have a property of ductility and malleability that is  metals can be drawn into wires or any other shape by beating or stretching the metal by putting the tensile strength or shear strength that pulls them apart . But while compression the metals are squeezed together which affects the hardness of a metal and they are not able to bear the compression force well and thus cannot show elastic-plastic behavior while compression .Therefore the statement given is true typical metals show elastic-plastic behavior in tension and shear but not in compression.

4 0
3 years ago
Analysis of the relationship between the fuel economy​ (mpg) and engine size​ (in liters) for 35 models of cars produces the reg
cestrela7 [59]

Answer:

The slope of -3.824 means that if we increase engine size by 1 unit, the mpg will decrease by 3.824 units

Explanation:

mpg=36.91−3.824•Engine size

Writing as y=mx+c then

mpg=−3.824•Engine size+36.91

Where mpy represent y, -3.824 represent m, engine size represent x and 36.91 represent c

Since from the equation y=mx+c m is the slope and c is the y-intercept, therefore,

The slope of -3.824 means that if we increase engine size by 1 unit, the mpg will decrease by 3.824 units

7 0
3 years ago
Other questions:
  • What are factor of safety for brittle and ductile material
    5·1 answer
  • Which of the following statement(s) are true?
    14·1 answer
  • A ceramic material can be defined as an organic compound consisting of a metal or semimetal and one or more nonmetals: (a) true
    9·1 answer
  • I have a resistor connected to a power supply that delivers a fixed voltage for any current (up to some maximum current). With a
    8·1 answer
  • A cylindrical metal specimen having an original diameter of 12.8 mm (0.505 in.) and gauge length of 50.80 mm (2.000 in.) is pull
    9·1 answer
  • The transistor is biased with a constant current source ???? = 1mA and β = 100. a) Neglecting the early effect, find the dc volt
    5·1 answer
  • A piston–cylinder device contains 0.85 kg of refrigerant- 134a at 2108C. The piston that is free to move has a mass of 12 kg and
    15·1 answer
  • A PLL is set up so that its VCO free-runs at 8.9 MHz. The VCO does not change frequency unless its input is within plus or minus
    11·1 answer
  • Some extremely hazardous materials used in welding operations include.
    12·1 answer
  • What type of diagrams are used to present the conditions that are available to control outputs based on inputs?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!