Write a program as per the application programming interface

Assignment Help JAVA Programming
Reference no: EM131082090

Introduction to Programming in Java - Reversed Sentence

Read three sentences from the console application. Each sentence should not exceed 80 characters. Then, copy each character in each input sentence in a [3 x 80] character array.

The first sentence should be loaded into the first row in the reverse order of characters - for example, "mary had a little lamb" should be loaded into the array as "bmal elttil a dah yram".

The second sentence should be loaded into the second row in the reverse order of words - for example, "mary had a little lamb" should be loaded into the array as "lamb little a had mary".

The third sentence should be loaded into the third row where if the index of the array is divisible by 5, then the corresponding character is replaced by the letter ‘z' - for example, "mary had a little lamb" should be loaded into the array as "mary zad azlittze lazb" - that is, characters in index positions 5, 10, 15, and 20 were replaced by ‘z'.

Note that an empty space is also a character, and that the index starts from position 0. Now print the contents of the character array on the console.

Program is written as per the application programming interface (API).

ReversedSentence

- Attributes

- Operations

+ public static String change5thPosition(String s)
+ public static String printChar2DArray(char[][] arr)
+ public static String reverseByCharacter(String s)
+ public static String reverseByWord(String s)
+ public static String truncateSentence(String s)

Reference no: EM131082090

Questions Cloud

Draw the tree for this experiment and find p[c1], p[c2] : Draw the tree for this experiment and find P[C1], P[C2], and P[Cn].
What challenges does this pose for greyhound : How would you describe BoltBus's strengths, weak-nesses, opportunities, and threats? Where does BoltBus fit within Greyhound's levels of strategic planning? What challenges does this pose for Greyhound?
Compute the capitalized costs for alternates : Compute the ”Capitalized Costs” for Alternates “ R” and” S” using the interest rate of 10% and then select the best choice. “ R “ First Cost - $120,000, Annual Operating Cost - $40,000, Salvage Value - $50,000, and Life (years) - 5. “ S “ First Cost ..
Determine partial derivatives are positive or negative : Quiz 4. Level curves are shown for a function f. Determine whether the following partial derivatives are positive or negative at the point P
Write a program as per the application programming interface : Program is written as per the application programming interface (API). Read three sentences from the console application. Each sentence should not exceed 80 characters. Then, copy each character in each input sentence in a [3 x 80] character array.
In economy with income taxes : In an economy with income taxes, if the marginal propensity to consume were 0.8, the tax rate on income were 0.2, and the marginal propensity to import were zero: (a) How large an increase in government spending (with no change in taxes) would be req..
How many pounds of potatoes will she purchase : Janice really likes potatoes. At best any other goods are worth less than a dollar to her, potatoes cost $1.10 per pound, and she has $5.00 that she could possibly spend on potatoes or other items. Suppose she feels that the first pound of potatoes i..
Explain the significance of realignment in american politics : Explain the significance of realignment in American politics and make a prediction as to which groups may switch parties in the near (0-16 years) future
Shopping atmosphere based on your initial reaction : From the second e-Activity, evaluate the success of the company's retail image and its shopping atmosphere based on your initial reaction to the company Website.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write a program to recognise the contour of an image

I think there are only small changes to be made, and I would be very grateful if you could show me what to change so that it works properly.

  How is the location of the click point determined

When a mouse event is generated how is the location of the click point determined?

  An array of integers and returns the range of values

Write a method called range that accepts an array of integers and returns the range of values in the array. The range is defined as 1 more than the difference between the maximum and minimum values in the array. For example, if an array called list c..

  Assignment on computer memory hacking

Describe what hacking of memory or hacking of RAM means. Examine the common tools that hackers use to hack into memory of computing devices. Detail two (2) real-life examples of such tools in action.

  Write a java application that reads a file containing text

Write a Java application that reads a file containing text. Your program should read each line and display it on the console screen preceded by line numbers. If the input file is:

  Recursive method

What will happen when the following recursive method is executed with an initial input value of 10?public int recursiveMethod(int input)

  Create the benefit class

create the Benefit class

  Int variable with a boolean variable

In java programming Can we compare int variable with a boolean variable?

  Changed to value-receiving and value-returning

The methods are to be changed to value-receiving, value-returning and a combination thereof. Therefore, when you call these methods make sure you send the correct arguments and properly process the value that is returned.

  Write a rap about classes that rivals the javadev group

Write a rap about classes that rivals the JavaDev group. Write just a few sentences and see if your classmates can add on.

  Create a recursive factorial program

Assignment 1: Create a recursive factorial program that prompts the user for an integer  N  and writes out a series of equations representing the calculation of  N !. For example, if the input is 4, the output could be:

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