In java please!

Complete the checkCharacter() method which has 2 parameters: A String, and a specified index (int). The method checks the character at the specified index of the String parameter, and returns a String based on the type of character at that location indicating if the character is a letter, digit, whitespace, or unknown character.

Ex: The method calls below with the given arguments will return the following Strings:

checkCharacter("happy birthday", 2) returns "Character 'p' is a letter"
checkCharacter("happy birthday", 5) returns "Character ' ' is a white space"
checkCharacter("happy birthday 2 you", 15) returns "Character '2' is a digit"
checkCharacter("happy birthday!", 14) returns "Character '!' is unknown"

Answers

Answer 1

Answer:

class Main {

   public static String checkCharacter(String str, int index) {

       char character = str.charAt(index);

       if (Character.isLetter(character)) {

           return "Character '" + character + "' is a letter";

       } else if (Character.isDigit(character)) {

           return "Character '" + character + "' is a digit";

       } else if (Character.isWhitespace(character)) {

           return "Character '" + character + "' is a white space";

       } else {

           return "Character '" + character + "' is unknown";

       }

   }

   public static void main(String[] args) {

       System.out.println(checkCharacter("happy birthday", 2));

       System.out.println(checkCharacter("happy birthday", 5));

       System.out.println(checkCharacter("happy birthday 2 you", 15));

       System.out.println(checkCharacter("happy birthday!", 14));

   }

}

Explanation:

This answer was created using AI and it looks very correct to me.


Related Questions

After sending a business e-mail, how long should you generally wait before following up for a response? Select one.

Question 7 options:

It’s never good etiquette to follow up


End of business day


24 hours


48 hours

Answers

After sending a business email, we have to wait for : End of business day.

After sending a business email, it is generally considered appropriate to wait until the end of the business day before following up for a response. This allows the recipient sufficient time to review their emails and respond accordingly. By waiting until the end of the business day, you demonstrate patience and respect for the recipient's schedule and workload.It's important to note that the appropriate timeframe for following up may vary depending on the urgency and nature of the email. If the matter is time-sensitive or requires immediate attention, it may be appropriate to follow up sooner, such as within a few hours or by the next business day.It's worth considering any specific instructions or expectations provided by the recipient or your company's communication protocols. Some organizations may have defined response timeframes or guidelines for follow-ups that you should adhere to.It's essential to strike a balance between being proactive and respectful of the recipient's time and workload when deciding when to follow up on a business email.

The correct option is: End of business day.

For more such questions on business email

https://brainly.com/question/30129889

#SPJ8

1. A company that produces office organizers is currently utilizing 10 hours per day to complete 90 pcs of the product. Engr Ulymarl, the senior process engineer proposes to do minor change in the process flow to avoid redundancy. By doing this, the output increased to 110 pcs. The material cost per organizer is BD 5; additional supplies needed to complete the organizer cost BD 1.50 and labor is paid at the rate of BD 2.5 per hour, energy cost is assumed to be BD 1.5 while water cost is at BD 1.75. a. Is there any improvement in productivity with the changes that have been implemented by the process engineer? b. Prove your answer though presenting the labor productivity, multifactor productivity and productivity improvement. c. What is your conclusion on the action done by Engr Ulymarl ?

Answers

a. Yes, there is an improvement in productivity as the output increased from 90 to 110 pcs.

b. Labor Productivity: 11 pcs/hour. Multifactor Productivity: 0.88 pcs/(BD 11.75) per day. Productivity Improvement: 22.2% increase.

c. Engr Ulymarl's action improved productivity by increasing output per hour and overall efficiency, leading to positive results and potentially better profitability.

a. Yes, there is an improvement in productivity with the changes implemented by the process engineer. The output increased from 90 to 110 pcs, indicating higher productivity.

b. To prove the improvement in productivity, we can calculate the following metrics:

Labor Productivity: Divide the output (110 pcs) by the labor hours (10 hours) to obtain the labor productivity per hour .

         Labor Productivity = Output / Labor Hours

Multifactor Productivity: Sum up the costs of materials, additional supplies, labor, energy, and water, and divide the output (110 pcs) by the total cost to calculate the multifactor productivity.

        Multifactor Productivity = Output / (Material Cost + Additional Supplies.              

       Cost + Labor Cost + Energy Cost + Water Cost)

Productivity Improvement: Compare the initial and improved productivity measures to determine the percentage increase.

        Productivity Improvement = ((Improved Productivity - Initial        

        roductivity) / Initial Productivity) * 100

c. Engr Ulymarl's action resulted in a significant improvement in productivity. The increased output per hour of labor indicates higher efficiency. The labor productivity, multifactor productivity, and productivity improvement calculations would provide concrete evidence of the positive impact of the process flow changes. The proposed actions by Engr Ulymarl have successfully enhanced productivity, leading to better output and potentially higher profitability for the company.

For more such question on productivity

https://brainly.com/question/21044460

#SPJ8

Other Questions
What types of nonverbal cues do you think are the most important in social perception and why? What do you think social interactions would be like without a fine-tuned skilled to read faces? Estimate the cost of expanding a planned new clinic by 8.4,000 ft2. The appropriate capacity exponent is 0.62, and the budget estimate for 185,000 ft2 was $19 million. (keep 3 decimals in your answer) For the beam shown below, calculate deflection using any method of your choice. Assume M1=30kNm, M2 = 20kNm and L=5 m. In managing the global supply chains, a company shall focus on which of the following areas:Material flowAll areas shall be included.Information flowCash flow Which sentence best describe what happened to the total mass of the sealed jar after the nail rusted and select the answer that best match your think Explain what happens to the mass before and after the nail rusted Nails in a Jar Jake put a handful of wet, iron nails in a glass jar. He tightly. closed the lid and set the jar aside. After a few weeks, he noticed that the nails inside the jar were rusty. Which sentence best describes what happened to the total mass of the sealed jar after the nails rusted? A The mass of the jar and its contents increased. B The mass of the jar and its contents decreased. C The mass of the jar and its contents stayed the same. Ethanol, C2H5OH (7), is a common fuel additive used in gasoline. The balanced chemical equation for the combustion of ethanol is below: CH-OH (1) +3 02(g) 3 H2O(g) + 2 CO2 (g) Calculate AHEX for the combustion of ethanol using the standard enthalpies of formation of the products and reactants. Construct a Lagrange polynomial that passes through the following points: -2 -1 0.1 1.3 14.5 -5.4 0.3 0 X y 3.5 4.5 Calculate the value of the Lagrange polynomial at the point x = 2.5. If x(t) satisfies the initial value problemx + 2px + (p2 + 1)x = (t 2), x(0) = 0, x(0) = v0.then show that x(t) = (v0 + e^(2p)u(t 2))e^(pt) sin t.Here denotes the Dirac delta function and u denotes the Heaviside step function as in the textbook. The orbit of a planet is a very squished ellipse. Its eccentricity is closest toa) unknownb) 0c) 1 The inside of a house is kept at a balmy 28 C against an average external temperature of 2 C by action of a heat pump. At steady state, the house loses 4 kW of heat to the outside. Inside the house, there is a large freezer that is always turned on to keep its interior compartment at -7 C, achieved by absorbing 2.5 kW of heat from that compartment. You can assume that both the heat pump and the freezer are operating at their maximum possible thermodynamic efficiencies. To save energy, the owner is considering: a) Increasing the temperature of the freezer to -4 C; b) Decreasing the temperature of the inside of the house to 26 C. Which of the two above options would be more energetically efficient (i.e. would save more electrical power)? Justify your answer with calculations. The inverter of a 1000MW HVDC project is connected. with a 400kV AC system with 120mH equivalent source inductance. Find the SCR. And to describe the strength. of the system(strong, medium, weak, very weak?). If the reactive power is compensated by the connection of capacitors with 560MVA, find the ESCR. Using Laplace Transform to solve the following equations: y+5y=sin2t Leaming Goal: To use the principle of work and energy to defermine charactertistics of a system of particles, including final velocities and positions. The two blocks shown have masses of mA=42 kg and mg=80 kg. The coefficent of kinetic friction between block A and the incined plane is. k=0.11. The angle of the inclined plane is given by =45 Negiect the weight of the rope and pulley (Figure 1) Botermine the magnitude of the nomal force acting on block A. NA Express your answer to two significant figures in newtons View Avaliabie Hinto - Part B - Detemining the velocity of the blocks at a given position Part B - Determining the velocity of the blocks at a given position If both blocks are released from rest, determine the velocily of biock 8 when it has moved itroigh a distince of 3=200 mi Express your answer to two significant figures and include the appropriate units: Part C - Dctermining the position of the biocks at a given velocity Part C - Detertminang the position of the blocks at a given velocily Express your answer fo two significist figures and inciude the kpproghtate units A time period of a simple pendulum of length L on earth is 2.0 s and suppose it is taken to moon to measure the time period there and its period is found to be 4.90 s on moon. From these information find the value of g on the moon. Take the value of g on earth = 9.80 m/s2 Find solutions for your homeworkFind solutions for your homeworkbusinessaccountingaccounting questions and answersat practical capacity, golding uses 22,000 check processing hours. required: 1. calculate the copacity cost rate for the checking account process. round your answer to the nearest cent. x perhourif the total number of statemenits issued was 30,000 , calcuiate the cost of the issuing statements activity. 2. assuming there are 2,000 interest-bearing checkingQuestion: At Practical Capacity, Golding Uses 22,000 Check Processing Hours. Required: 1. Calculate The Copacity Cost Rate For The Checking Account Process. Round Your Answer To The Nearest Cent. X PerhourIf The Total Number Of Statemenits Issued Was 30,000 , Calcuiate The Cost Of The Issuing Statements Activity. 2. Assuming There Are 2,000 Interest-Bearing Checkingplease helpstudent submitted image, transcription available belowstudent submitted image, transcription available belowShow transcribed image textExpert Answer1st stepAll stepsFinal answerStep 1/3Answer:1Capacity cost rate = Total resources /...View the full answeranswer image blurStep 2/3Step 3/3Final answerTranscribed image text:At practical capacity, Golding uses 22,000 check processing hours. Required: 1. Calculate the copacity cost rate for the checking account process. Round your answer to the nearest cent. X perhour If the total number of statemenits issued was 30,000 , calcuiate the cost of the issuing statements activity. 2. Assuming there are 2,000 interest-bearing checking accounts, calculate the cost per account using the activity rates from Requilement 1. Round your answers to the nearest cent. Unit cost 1 3. A time equation is used to assign resource costs to checking accounts. Select a time equation for the interest-bearing checking account product. Again, assuming that there are 2,600 interest bearing sccountr, show that the resource cost per account is the same as calculated in Requirement 2 . Round your answers to the nearest cent. s 4. What if process improvements decreased the number of customer inquiries, leading to a 10 percent reduction in check processing hours and a $12,320 reduction in total resource costs? Calculate the capacity cost rate for the checking account process, Round your answers to the nearest cent. X perbour Update all the activity rates for these changes in eperating conditions. "Correlation is not causation." This renowned statement addresses a frequent misinterpretation of correlation as causation. Please state an example from your field (Engineering if possible) which presents us an example of this misinterpretation. As a second step, try to indentify the missing causal structure and represent the correct causal network explaining the situation. Question 1 10 Points A rectangular beam has dimensions of 300 mm width and an effective depth of 530 mm. It is subjected to shear dead load of 94 kN and shear live load of 100 kN. Use f'c = 27.6 MPa and fyt = 276 MPa for 12 mm diameter U-stirrup. Design the required spacing of the shear reinforcement. Fill in the blank and short answer tests rely on what aspect of retrieval? Sensory memory Relearning Recognition Recall QUESTION 8 Which of the following is NOT an implicit memory? knowing that baseball is a sport driving a car riding a bike buttoning a shirt QUESTION 9 What is an example of procedural memory? Riding a bicycle Remembering your brother's last birthday party Remembering the first day of school Remembering the state capitals A spatula of sodium hydrogen carbonate was placed in a boiling tube.lemon juice was added dropwise while shaking until no other change was seen. Give the expected observation and explain it If350kgof hydrogen could be entirely converted to energy, how many joules would be produced?I