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

  In a four- to five-page paper analyze a business task that

in a four- to five-page paper analyze a business task that you would like to computerize. consider how you could use

  The difficulties in identifying the source of a packet sent

Based on your study of the upper layers of the tcp/ip architecture, what are the difficulties in identifying the source of a packet sent over the Internet?

  Why is the page replacement algorithm run in the kernel

Why is the page replacement algorithm run in the kernel instead of in an external memory manager? How about SEND capabilities?

  Which major providers offer cdma and which pcs

Through a web search contrast CDMA with PCS systems. Which major providers offer CDMA, and which PCS? Search for the keyword WAP.

  Which term involves replacing the old system with new system

Which term involves replacing the old system with a new system? When does system conversion (direct, parallel, pilot, or phased) occur? During implementation, how is alpha testing different from beta testing?

  A program that uses a scanner to take a single user input

Think of your phone number, or Social Security number. Write a program that uses a Scanner to take a single user input.

  Write a multitasked vectorized code in fortran-ninety

Write a multitasked vectorized code in Fortran 90 for matrix multiplication using four processors with a shared memory. Assume square matrices of order n = 4k.

  Types of organizational and computer architectures for

desktop virtualization is growing in popularity. use the internet and strayer library to research this technique.

  Who needs to be on the incident response team

In today's highly connected world, cyber incidents happen on a daily basis. Every corporation from the very large to small and medium (SME) companies.

  Does your company have a current disaster recovery plan

Does your company (or school) have a current disaster recovery plan? What are some of the activities involved in it? Do you feel confident that your company.

  What are the significance of safes

Using proper APA formatting write 600 words, not including your heading or reference pages discussing the significance of these information in a security plan.

  How frequently can the stuff bits used

Suppose a multiplexer has two input streams, each at a nominal rate of 1 Mbps. To accommodate deviations from the nominal rate, the multiplexer transmits at a rate of 2.2 Mbps as follows.

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