Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Simple Java question 5

BunkerHillBroad
BunkerHillBroad 


Write a Java method named sentenceType that accepts a single String parameter named s and returns a String that indicates whether the actual argument passed was declarative, exclamatory, or interrogative — according to whether the last character in s is a period (.) , an exclamation mark (!), or a question mark (?). Your method should return the message bad ending if the last character is none of these punctuation marks. You must create a method that has return type String, it's not enough to just print the sentence type in the method. Attachments
Tags Clarifications

Answers

Simple Java question 5 - Solution

mariobeka
mariobeka 



Open the solution file with any text editor. Attachments Screenshots
Purchase Answer