Question: ///////Help with Java ////// Write a program that gets input for a string, then output a substring of this string character by character showing the
///////Help with Java //////
Write a program that gets input for a string, then output a substring of this string character by character showing the upper case, lower case, initial case, binary, and hex values of each character. Repeat until quit.
Using
*Integer Types and Floating Point Types
*Char Type and ASCII Character Set
*Type Conversions
*Prefix/Postfix Modes for Increment/Decrement
*For loop header detail
*Hexadecimal, Octal, and Binary Numbers
Get input for a string containing both numbers and letters of any length Get input for a substring length (0 to quit) Use a for loop with postfix notation to increment through the string and printing the following: o Use a ternary operator (pg. 531) that sets the substring length to the actual string length if the value entered for the substring is longer than the actual string length o The initial digit/character o The ASCII value of each character o The ASCII value of each integer converted to a string Notice the columns for the char/int Hint: isdigit would work great for this. o The Hex value of each integer/character output in upper case Use the Integer wrapper class to convert to Hex Output Thank you for playing!
////////////////////////////////////////////////////////
output result

////////////////////////////////////////
This is the code I am working with but it's the first week learning about it so Im really bad at this.
////////////////////////////////////////
import java.util.*;
public class AsciiWork { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String input; // input for string of any length char ch; // ascii associated character int ascii; // ascii value of character System.out.println("Please enter a string of any length: "); input = scan.next(); // scanner input System.out.println("Initial\tASCII
Comments included would be greatly appreciated.
Please enter a string of any length: Ken123 Initial ASCII char ASCII int Hex 4B 101 65 6E 110 49 31 32 50 51 33 Thank you for playing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
