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

  Write an application that plays "guess the number"

Write an application that plays "guess the number" as follows: Your application chooses the number to be guessed by selecting an integer at random in the range 1-1000. The application then displays the following in a label

  Write java parallel arrays by the jumpinjive.java

Write the code that prints the name and price of the add-in or error message and and also write the code that prints the total order cost.

  Write a program that ask the user to enter a usemame

Write a program usennuftevalidator.java that ask the user to enter a usemame and checks whether the usemame meets the following criteria

  Find the errors in the java code

What are the errors in the following codes: What would correct the errors?

  Credit card expenses

You started recording every credit card transaction so that you can analyze your monthly expenses. You used an Excel worksheet to track dates, places, categories, and amounts. Because you are a consultant who travels periodically, you also have bu..

  Develop a good understanding of how this code works.

By now you should have studied the original version of the SalesAward and related classes. You should have a good understanding of the SalesTeam and SalesAward classes. You are already familiar with the Person class. Now what you need to do is upd..

  Java program for real estate agent

Write down java program for real estate agent. Program must perform the following tasks: ask users for average house price for the each of past 5 years for single family residence of 1500 square feet.

  Your task for this project is to design a program to help a

your task for this project is to design a program to help a videorental store operatorrecord clients transactions.nbsp

  Modify the book class to accommodate multiple authors

modify the Book class to accommodate multiple authors using one of the components from the Java Collection Framework.

  Number for all nonnegative values

Please if you could show the work for each problem and also if you could advise the theorem used to solved the problem. Does n2 + n +11 always represent a prime number for all nonnegative values of n?

  Explain the problem and then write the pseudo code for it

There are Java compilers and interpreters. Write a 1 page paper on compilers and interpreters (2-3 paragraphs on each topic). Discuss the advantages and disadvantages of compilers and interpreters.

  Write client code to call the print method of counter.

Write client code to deposit 7 quarters, 3 dimes, 10 nickels, and 17 pennies in counter. Output the new status of counter using the toString method.

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