Question: Please write a testing class for the following code: For the second part of the programming assignment, you will be implementing a StringManipulation class that

Please write a testing class for the following code:

Please write a testing class for the following code: For the secondpart of the programming assignment, you will be implementing a StringManipulation class

For the second part of the programming assignment, you will be implementing a StringManipulation class that can perform the followings operations: public class StringManipulation - static string topostfix(String infix) - takes in a string of infix expression and returns the postfix expression for that string. The input string will be a legal infix expression and has the followings characters: numbers, operations (+,,,/), left parenthesis "(", and right parenthesis ")". - static int result(String postfix) - takes in a string of postfix expression and returns the final value of that expression. The input string will be a legal postfix expression and has the followings characters: spaces, numbers, and operations (+,,,/). There will be one space between each pair of numbers, or pair of a number and an operation. Please note that operation "/ is an integer division, i.e. cutting of anything to the right of the decimal points. The numbers in the postfix expression can have multiple digits but will be in the range of int primitive type. For example: a valid postfix expression is " 320+6 ". - static String smallestNumber(String number, int n ) takes in a string containing only digits from 0 to 9 representing a number, and an integer n such that n is less than or equal to the length of the string. The functions should return the smallest number obtained by deleting n digits from the input string. The result string should not have any leading zeroes, and deleting leading zeros should not count toward n digits. For example, number = "70004" and n=1, so the result should be "4" by deleting digit " 7". - static String unbelievableString(String s)- takes in a string containing only lowercase and uppercase English letter, and returns the unbelievable string obtained by deleting some characters from the input string such that the following condition hold: The unbelievable string is a string without any two adjacent characters s[i] and s[i+1] such that: 0i s.length 2 s[i] is an uppercase letter and s[i+1] is the same letter but in lowercase or vice-versa. For example, we have a string "abDDdddE". Now there are "Dd" in "abDDdddE" that doesn't satisfy the condition, so we will delete these two characters to have the string "abDddE". Next, "abDdde" still has "Dd", so we will delete these too, and have the final result string " "abdE" satisfying the condition

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!