Display the middle character of a string

Assignment Help Computer Engineering
Reference no: EM132200494

Write a Java program with 3 methods.

A main method which calls the other 2 and provides any parameter data those methods require. Meaning it will need to prompt for a sentence or String of characters to be passed to each of the other two methods.

A method that displays the middle character(s) of a String. This method requires a parameter be passed to it containing a sentence.

If the length of the string is odd there will be only one middle character

If the length of the string is even there will be two middle characters

Sample output:

Input string: The rain in spain falls mainly in the plain.

Middle character(s): ls

A method that counts all words in a String (a word defined as any set of contiguous characters separated by a space. This method requires a parameter be passed to it containing a sentence.

Sample output:

Input string: The quick brown fox jumps over the lazy dog.

Number of word(s): 9

Reference no: EM132200494

Questions Cloud

Write a java for loop that iterates an array of type double : Write a Java for loop that iterates an array of type double named dArray, of any size, and replaces each element with its squareroot.
Balance the ions and complete the circuit : A salt bridge is used in voltaic cells to balance the ions and complete the circuit. Describe this scenario. (hint;use a diagram)
What are the kinetic theory assumptions about ideal gases : What are the kinetic theory assumptions about ideal gases. State the ideal gas equation.
Types of possible transitions that can occur : Draw the energy level diagram of Hydrogen showing all the types of possible transitions that can occur. Show the IR,UV,VL.
Display the middle character of a string : A main method which calls the other 2 and provides any parameter data those methods require.
Write a java method to multiply two n times n matrices : Write a Java method to multiply two N times N matrices. The two matrices are received parameters. The result should be returned from the method.
Create a number of threads : Create a number of threads-for example, 100-and each threadwill request a pid, sleep for a random period of time, and then release the pid.
Find all n prime numbers that are positive integers greater : How to write a java code that take a given number n , and finds all n prime numbers that are positive integers greater .
Provide the actual recursive implementation of algorithms : A one parameter constructor that takes a File object as a parameter. The dictionary should be populated with the words stored in the file.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How the fact-finding techniques will be used

With this task in mind, create a slide presentation that describes each fact-finding technique and how the fact-finding techniques will be used throughout the development of the database system.

  Calculate the determinant of a user-entered square

It will prompt the user to fill a square matrix and store the input into the 2D array. The second function is determinant().

  Explain how much compromise is made in aggressive mode

How much compromise is made in aggressive mode with respect to security? What is the gain with respect to efficiency?

  Deploying the 4-to-16 decoder

Develop the 4-to-16 decoder utilizing these elements. You should not utilize any additional elements.

  Describe the measurable benefit of progressing up cmmi model

Describe the measurable benefits of progressing up the CMMI model. From an auditing perspective, determine the manner in which these benefits might be observed.

  Define web server cannot set client-side cookies

The browser also ensures that the attacker.com web server cannot set client-side cookies using the Set-Cookie header

  Benefit of web-based computing environment

Web-based applications like e-commerce and e-government exemplify the platform shift from the client/server computing to the Web-based computing so for this essay question.

  Identify the main elements of the us criminal

recognize the key elements of the US criminal justice system and explain how they relate to the job of the computer forensic investigator? Support the opinion or any arguments you may make.

  Which arithmetic operator gives you the remainder

A number that is evenly divisible by 2 is even. An odd number has a remainder of 1 when divided by 2. Which arithmetic operator gives you the remainder?

  Companies still fail in their use of information technology

Why do big companies still fail in their use of information technology? What should they be doing differently.

  Create a finite automata

Create a finite automata that takes only the words baa, ab and abb and noother strings longer or shorter

  Write the program with at least two functions to solve

Write the program with at least two functions to solve the following problem.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd