man.op mpc multply h man.cpp monpp include \"mbed.h\" ULCD 4DGL GLCD (ps.p1o.pi1
ID: 3599785 • Letter: M
Question
man.op mpc multply h man.cpp monpp include "mbed.h" ULCD 4DGL GLCD (ps.p1o.pi1) r char GetReyInput (void) 9 int main) I char data; 12ULCD.printt("Enter a character: 13data GetReyinputO 14 po.printfse Inr", data)a 5LCD.printf("inrthe character that you entared i 16 uLCD.print f ("te 'tr” , data); / all your funetion to get a chazacter //printp what you type to the Tera Term screen /NC: print the character to the 1D acreen 19 o Define and write function. Note how this matches up with funotion prototype Eor this 21 can have the sane or different names from the calli funetion. Tariables in functiona ng funet ion 23 char Getkeyinput (void) 24char e 2s pe.getoo 27 return //NCs need to return the chazacter to mainExplanation / Answer
package com;
public class ReverseString {
public static void main(String[] args) {
boolean isvalidate=ReverseString.validateString(args[0]);
if(isvalidate){
String value=ReverseString.reverseString(args[0]);
}
else{
System.out.println("Please enter valid String ! String should not be less then 5 character");
}
}
public static String reverseString(String input){
String result="";
char [] strValue=input.toCharArray();
for(int i=strValue.length-1;i>=0;i--){
result=result+strValue[i];
}
System.out.println(result);
return result;
}
public static boolean validateString(String strVal){
boolean flag=false;
if(strVal.length()>=5){
flag=true;
}
else{
flag=false;
}
return flag;
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.