Reference no: EM131587477
Directions
The files must be called <LastInitialFirstInitialUnit3Ch12.java>
Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.
Only submit the .java file needed to make the program run. Do not submit the .class file or any other file.
Style Components
Include properly formatted prologue, comments, indenting, and other style elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.
Topics covered in chapter
Topics with * are covered in this assignment.
*Integer Types and Floating Point Types
*Char Type and ASCII Character Set
*Type Conversions
*Prefix/Postfix Modes for Increment/Decrement Embedded Assignments
Conditional Operation Expressions Short Circuit Evaluation
Empty Statement
Break statement within a loop
*For loop header detail Enumerated types
*Hexadecimal, Octal, and Binary Numbers
Basic Requirements
Write a program that gets input for a string, then output this string character by character showing the upper case, lower case, initial case, binary, and hex values of each character.
LiFiUnit3Ch12.java
• Get input for a string
• Print a header row per the example at the bottom.
• Loop through the string printing the following:
o The lower case of each character
o The upper case of each character
o The initial case of each letter (case not changed)
o The ASCII value of each character
o The Binary representation of each character broken out in 2 sections of 4 bytes each (see example).
- Use the Integer wrapper class specifying the radix. Refer to the java docs for more info
o The Hex value of each character output in upper case
- Use the Integer wrapper class to convert to Hex
• Hints
o There is no need to convert case for non-letters although no points will be taken off if they are converted
o The ASCII, Binary, and Hex are based on the initial case entered
o Notice the binary values are padded with zeros on the left to make them the correct number of digits
A separate method would be best to accomplish this
Sample output is provided below. Be sure to mimic it exactly except for search value and random numbers.
Output of lower case characters correctly
Output of upper case characters correctly
Output of ASCII correctly
Output of Binary correctly
Output of Hex correctly
NOTE: Complete your activity and submit it by clicking "Submit Assignment"
Total Percentage