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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. 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!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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