Question: Submission instructions: 1. Write the programs in Java and save them as .java files. Test your programs and fix any compilation errors 2. Copy and
Submission instructions: 1. Write the programs in Java and save them as .java files. Test your programs and fix any compilation errors 2. Copy and paste your final version of the programs to ONE MS Word document and save it as a docx file. 3. Please submit both your source codes (.java files) and the Word document to the Blackboard. I will test the programs by using the source codes (.java file) and make comments on the Word document from the Blackboard grading area Please note that no late homework will be accepted. Your submission will not be graded unless they have both source codes and Word document files submitted. 1. A palindrome is a string of characters (a word, phrase, or sentence) that is the same regardless of whether you read it forward or backward assuming that you ignore spaces, punctuation, and case. For example, Race car is a palindrome. So is A man, a plan, a canal: Panama. Write a program that use a stack to test whether a string is a palindrome. 2. Suppose that you read a binary string-that is, a string of Os and 1s-one character at a time. Write a program that use a stack but no arithmetic to see whether the number of Os is equal to the number of 1s. When these counts are not equal, show which character- -0 or 1-occurs most frequently and by how much its count exceeds the other's 3. If n is a positive integer in Java, n 10 is its rightmost digit and n/10 is the integer obtained an integer n in decimal. Now observe that you can display n in any base between 2 and 9 by replacing 10 with the new base. Revise your method to accommodate a given base. Write a by dropping the rightmost digit from n. Using these facts, write a recursive method that displays program to demonstrate the methods MacBook Pro 4 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
