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

  Computer science and information system

In the College of Computer Science and Information System, forty students were asked to rate the quality of teaching of his Course Instructor in the class room environment on a scale of 1 to 10 (1 means minimum standard of teaching and 10 means ex..

  Prepare a java program to play pig

Pig is a two player game where the players take turns repeatedly rolling a single 6 sided die. A player repeatedly rolls the die until one of two events happen:

  Error conditions as compared to using exception handling

What are the advantages and disadvantages of testing for error conditions as compared to using exception handling when performing input or output?

  Create an overloaded constructor that provides values

Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor (the factors are + and -).

  Create three classes for a customer

a travel manager and have a job of buying a travel package for a customer. You must create three classes for this programming challenge: Customer, Ticket, and TravelManagerDemo.

  Put all the given records in to appropriate objects

Put all the records in to appropriate objects. Put all the objects in to a data structure. Loop through the data structure and print out (on screen)

  Java script program for song

Construct a JavaScript program that declares and prints an array that includes at least twenty of your favorite songs.

  Create a panel with borderlayout

Create a panel with BorderLayout. Add a button labeled "OK" to the south side of the panel - given the program, show the values of the array

  Implement the scan, c_scan, and look disk scheduling algo

The code must have a separate method for each scheduling algorithm and they all have to be called from the main() method.

  Modify the inventory program by adding a button to the gui

If the first item is displayed and the user clicks on the Previous button, the last item should display. If the last item is displayed and the user clicks on the Next button, the first item should display. Add a company logo to the GUI using Java ..

  Create an interface that includes a group box

Create an interface that includes a group box that contains 3 check box and 3 text box, the three text boxes should be invisible when the application starts

  Create a project in eclipse

Create a new project

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