Create a new java application that has the given method

Assignment Help JAVA Programming
Reference no: EM132101908

Problem :

Get familiar with the Stack class in Java and its methods.

Create a new Java Application that has the following methods. Test all your methods in the main method.

1. Write a method reverseChar() to print a sentence in reverse order. Use a Stack to reverse each character.

Example: if the user enters a sentence "ABC DEFG", the program will display "GFED CBA"

2. Write a method reverseWord() to print a sentence reverse order. Use a Stack to reverse each word. Example: If

the user enters a sentence "Live and Let Live" the program will display "Live Let and Live"

3. Write a method secretMessage() that take a sentence containing alphabets and asterisk characters only. All characters are separated by a space. Every character is pushed into a stack. The stack is then processed in the following way:

• All elements are popped

• While popping, if an asterisk is read then the next alphabet in the stack is popped and printed to console

• CRY*S*MTAA*TE* ----> E A S Y

4. Write a method isBalanced() that takes an expression and returns if it has a balanced number of parenthesis or not.

Example: if the user inputs ( 2 + 3 / (4 -2) ) + (5 % 3) the output is true.

If the user inputs ( 2 + 3 / (4 -2) + (5 % 3) the output is false.

5. Write a java method postFixEpr() to evaluate a post fix expression. To make the problem easy assume that we are dealing only with expression that contains only number of 1 digits.

Example of post fix expression

• 3 4 + =

• 7 5 + 8 2 - * =

• 1 3 4 5 6 7 + - * 3 / + =

Reference no: EM132101908

Questions Cloud

Write the corresponding policy statement : Is it necessary to include standards, baselines, guidelines or procedures in this policy document? Explain your answer.
Create a style rule for the figure element : Each of the popup boxes has been placed within a figure box. Initially, these popup boxes should be clipped so that only the number is shown.
Prompt the user for the category and name of the item : Prompt the user for the category and name of the item. If the item is included in the menu, then provide the option to change.
Which smartphone would you buy if you primarily care : Which smartphone would you buy if you primarily care about battery life and run this app all the time (both smartphones have the same battery)?
Create a new java application that has the given method : Write a method reverseChar() to print a sentence in reverse order. Use a Stack to reverse each character.
Calculate the minimum clock rate that must be achieved : Calculate the minimum clock rate that must be achieved, assuming that the time spent on I/O is negligible.
Describe the disadvantages associated with this design : A popular word processor previously contained an anthropomorphic character to assist users as they worked in the program.
What would you expect the execution time of the program : What would you expect the execution time of the program to be in seconds with the new floating-point co-processor?
Explain when java object variables behave like pointer : Object variables in Java are a hybrid of pointer and reference variables. Use an example to show how to define an object variable in Java.

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