Question: #1384

INSY3433 Assignment 3 – Strings Exceptions Scored

INSY3433 – Business Applications Development
Assignment 3 – Strings, Exceptions

Solve both of these problems by writing a Java program for each. Submit assignment answer programs via email as two .java attachments (one file per problem). Use descriptive names for the .java files (e.g., Palindrome.java, MathMethods.java). The subject line of your email should be: INSY343 – Assignment 3 Answers. Include your name in the body of the email and in each program.


Comment your programs (using // on a line, or after a statement). Use proper indenting. You should work out the solution on your own (you can use lecture slides and the textbook). Programs that do not compile or run correctly can still be submitted for partial credit.

Problem 1 (Palindrome - Using String)
A palindrome is a word or phrase that is the same forwards or backwards. Here are some
examples:
Dad
Madam I'm Adam
Amore, Roma
Write a program that prompts for a word or phrase, and test if it is a palindrome. If it is, print
'yes'. Otherwise, print 'no'. For getting input, see the Scanner.next( ) method. Several String
methods will be useful.
Problem 2 (Math Methods)
Write a program that gets a number from the user and using the methods of the Math class,
calculates and displays for this number each of these:
- absolute value
- floor
- ceiling
- round
- square root

Solution: #1364

INSY3433 Assignment 3 – Strings Exceptions Scored

This Tutorial is rated A+ p...

Tutormaster
Rating: A+ Purchased: 11 x Posted By: Studyacer
Related Solutions
Comments
Posted by: Studyacer

Online Users