Write a program that gets input for a string


Basic Requirements:

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.

1) Get input for a string of any length

2) Get input for a substring length (0 to quit)

3) Loop through the string using an embedded assignment (pg. 530) in a while loop and printing the following:

o Use a “ternary operator” (pg. 531) that sets the substring length to the

o The substring initial case of each letter (case not changed)

o The substring lower case of each character

o The substring upper case of each character

o The substring ASCII value of each character

o The substring Binary representation of each character

- Use the Integer wrapper class specifying the radix. Refer to the java docs for more info

o The substring Hex value of each character output in upper case

- Use the Integer wrapper class to convert to Hex

o Get entry for the next substring length (0 to quit)

4) Subsequent substring lengths should use the same initial string (see example)

5) Output “Thank you for playing!” when 0 is entered for the substring length

Sample output is provided below. Be sure to mimic it exactly except for search value and random numbers.

Sample: Your output will vary based on input.

335_Sample output of string program.jpg

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program that gets input for a string
Reference No:- TGS01238137

Expected delivery within 24 Hours